Open djhocking opened 5 years ago
a3d7d1f7ed95048ff505174120c2633da5354b97 @djhocking
The covariance between mean occupancy and detection still needs to be added to the model but I'm sure as to how to code it. All of the examples I have found are confusing....
I found this link which may be helpful??? https://vtechworks.lib.vt.edu/bitstream/handle/10919/82537/Rich_LN_D_2016_support_3.pdf?sequence=4&isAllowed=y
And this link describes it using STAN instead of JAGs https://mc-stan.org/users/documentation/case-studies/dorazio-royle-occupancy.html
Hopefully the code that you have from the manuscript that we looked at during our meeting will be more helpful.
I'll keep looking into this as well....
Can you find the thesis from VT or the resulting paper where they describe the model? I can get this working but I am not quite sure why it's formulated this way and how it relates to using a multivariate normal with a covariance matrix. That's the approach I'm familiar with and what Dorazio did and what Bob Carpenter adapted for Stan.
I got it "working" with correlation between detection and occupancy using the formulation in the VT link.
However, it's really not able to estimate the correlation $rho$ or the variance term on the detection intercept $sigma.p$. When I tried constraining the variance it was even worse. It looks like species 6 is causing the problem. I didn't look into the data but I assume that there were very few observations of that species and maybe inconsistent observations. I thought that the multispecies model with have just pulled it towards the mean but it might be preventing convergence. It could be worth trying it without that species. Otherwise we can think about other model formulations or see if there are other issues.
I only ran really short MCMC trials but I don't think the major issues will change with longer runs. I've pushed the commit to github in the prep_data.R
file and the Code/JAGS/multi_spp_occ3.txt
JAGS code.
There was only one observation of species 6 (adult Pseudotriton ruber) so we can try just removing that data point to see if it will allow the model to converge. I'm about to look into what you just did and see if I can run it without that data point.
Add mulitvariate normal for covariance between mean occupancy and detection. Check if the inverse Wishart distribution is still the best prior for a multi variant normal.