You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on fitting a dynamic model (tMsPGOcc) to a bird community dataset, aiming to explore the community's occupancy response to a categorical variable, "Type," which represents land use/land cover (farming, restoration, and forest), as well as continuous landscape variables like NDVI. However, I encountered an issue when including both the continuous variable (NDVI) and the categorical variable ("Type") in the model. Specifically, the continuous variable appears to behave as if it were categorical. The model output generates 119 parameters for NDVI—one less than the total number of sites (120). To investigate further, I ran a single-species model (tPGOcc) for one species to check if the behavior persists, and the issue remained the same. I’ve attached a screenshot below to illustrate the problem (please disregard the low Rhat and ESS values, as I used low n.samples just to test the model's operation.).
If I exclude the categorical variable "Type" and retain only the continuous variable (NDVI), the issue disappears entirely, and the model output behaves as expected. Additionally, I conducted another test by selecting only the first year of sampling and running a static multispecies model (msPGOcc). In this case, the output was correct, generating a single parameter for NDVI at the community level. These small tests suggest that the issue may be specific to the dynamic models, which seem to be misinterpreting my input data. Below, I’ve included the tMsPGOcc output using only the continuous variable for your reference.
I look forward to hearing your thoughts and guidance on this.
The text was updated successfully, but these errors were encountered:
Thanks very much for bringing this to my attention. This indeed is a bug under some specific circumstances with the multi-season models. This bug only seems to happen when the categorical variable only varies across space and not also across seasons. In other words, the bug occurs when the categorical variable is given as a vector in the occ.covs portion of the data list. This isn't super nice behavior, so apologies for that. The quickest way to fix this would just be to supply the categorical variable as a site x season matrix in the data list (with the site-specific values simply repeated across the columns), which should make the problem go away. Let me know if that doesn't solve the issue for you.
I'm going to keep the issue open for now, as it is something I should fix to prevent the odd behavior from happening. Thanks again for pointing this out.
Thank you so much for your quick response and for looking into this issue. I really appreciate the explanation and the suggested fix.
I followed your recommendation and supplied the categorical variable as a site × season matrix in the data list, and that completely resolved the issue—the model now runs perfectly!
Thanks again for your help and for keeping this on your radar for a future fix. I appreciate your work on this great package!
Dear Jeff,
I have been working on fitting a dynamic model (tMsPGOcc) to a bird community dataset, aiming to explore the community's occupancy response to a categorical variable, "Type," which represents land use/land cover (farming, restoration, and forest), as well as continuous landscape variables like NDVI. However, I encountered an issue when including both the continuous variable (NDVI) and the categorical variable ("Type") in the model. Specifically, the continuous variable appears to behave as if it were categorical. The model output generates 119 parameters for NDVI—one less than the total number of sites (120). To investigate further, I ran a single-species model (tPGOcc) for one species to check if the behavior persists, and the issue remained the same. I’ve attached a screenshot below to illustrate the problem (please disregard the low Rhat and ESS values, as I used low n.samples just to test the model's operation.).
If I exclude the categorical variable "Type" and retain only the continuous variable (NDVI), the issue disappears entirely, and the model output behaves as expected. Additionally, I conducted another test by selecting only the first year of sampling and running a static multispecies model (msPGOcc). In this case, the output was correct, generating a single parameter for NDVI at the community level. These small tests suggest that the issue may be specific to the dynamic models, which seem to be misinterpreting my input data. Below, I’ve included the tMsPGOcc output using only the continuous variable for your reference.
I look forward to hearing your thoughts and guidance on this.
The text was updated successfully, but these errors were encountered: