Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differing mesh sizes for adults and juveniles #72

Open
TobyEAuckUni opened this issue Jun 7, 2024 · 7 comments
Open

Differing mesh sizes for adults and juveniles #72

TobyEAuckUni opened this issue Jun 7, 2024 · 7 comments

Comments

@TobyEAuckUni
Copy link

Hi,

I am trying to create an IPM for kauri (Agathis australis) as part of my PhD and I have split the trees up into adults (Diameter over 2.5cm) and saplings/seedlings (Diameter under 2.5 cm). The measurement variable is height for the saplings, and DBH for the adults. I am currently trying to build an IPM with 10,000 classes for the adults, and 1,000 for the saplings/seedlings, as the sapling/seedling stage only represents a small portion of the life cycle of kauri. However, when I try this, the lambda is too high to be feasible and the fecundity kernel is not correct, as it creates juveniles/seedlings in class 1-10 (as expected), but also class 100-110, 200-210 etc. Is there any way that I can go about fixing this, or correcting for this? (e.g. adjusting the fecundity kernel in R to change these values to 0 after the model is built?)

Thank you for creating this package, it is great, I am quite new to coding and population modelling and found it very user friendly!

Kind Regards,

Toby Elliott

@levisc8
Copy link
Collaborator

levisc8 commented Jun 8, 2024

Hi Toby,
Thanks for opening this up - I'm glad you're using the package! Rather than manually correct the kernels, it may be better to double check that the fecundity kernel is specified correctly (it sounds like there might be an indexing error). Do you mind sharing the IPM code and the parameters in the data_list (no need to share the raw data)? This would help work out the best way to fix the issue you're facing.

@TobyEAuckUni
Copy link
Author

TobyEAuckUni commented Jun 9, 2024 via email

@slevin-pivotbio
Copy link

Hi Toby,
(Sam here - using my work GH username). It looks like the code didn't attach properly. I don't think email attachments are preserved when replying to GitHub emails, so you may need to copy+paste the code itself into email response, or pop over to GitHub and attach it directly to your comment.

@TobyEAuckUni
Copy link
Author

Hi Sam,

Apologies about that, I have uploaded the .txt file of the code here, Github doesn't seem to support R files, but thank you again for this help!

Kind Regards,

Toby.

Elliott_IPMr.txt

@levisc8
Copy link
Collaborator

levisc8 commented Jun 11, 2024

Just looked at the code. Are you saying that you want the recruit sizes to max out at the 10th size class? If so, you might need to modify the "fecundity" kernel like so:

recruit_size_dist = ifelse(HGT_2 =< INSERT_MAXIMUM_HEIGHT_HERE, 
                           dnorm(Hgt_2, IX_Asym_Recruit_height.mean, IX_Asym_Recruit_height.sd),
                           0)

right now, there is only a minimum DBH for being reproductive, so the model doesn't know that it shouldn't make recruits that are larger than you'd expect (only that the recruits have some mean and variance, and the tails of that distribution may extend to unrealistic heights). Does that make sense?

@TobyEAuckUni
Copy link
Author

Hi Sam,

Thank you for the suggestion; I have had a go, and unfortunately, setting the upper limit for the saplings didn't seem to work. I have tried with different population states and have still had no luck. I have included a screenshot of one of my kernels, (with 500 sapling classes and 1000 adult classes to speed things up a bit). It correctly does the distribution at sapling classes 1 - 5 but repeats the exact distribution at classes 251 - 255. I tried with 100 sapling classes and 1000 adult classes, and it repeated the initial distributions 10x down the page.

Sorry about all this, and thank you again for your help!

Kind Regards,

Toby.

1-6
251-500

@levisc8
Copy link
Collaborator

levisc8 commented Jun 11, 2024

Ok, do you mind sending me the raw data you're using as well? You can send it to levisc8@gmail.com. That'll help me figure out what is going on internally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants