For stan_nlmer models, group specific terms are not being passed to posterior_predict.
Description:
I think I have encountered a possible error when trying to draw from the posterior predicted distribution of stan_nlmer models.
It appears that the group specific terms are not being passed to posterior_predict. In other words, it seems to behave as if re.form = NA and any predictions for groups end up drawn from the same posterior distribution. I have been able to replicate the problem using posterior_predict, add_predicted_draws etc.
The example below is drawn from the stan_nlmer vignette https://cran.r-project.org/web/packages/rstanarm/vignettes/glmer.html.
If i repeat the example in the vignette and in the new data change the level for Tree to a within sample tree, it generates the same distribution of predicted values as for the out of sample tree. I also tried passing group level terms (e.g. Asy|Tree , ~1|Tree) direct to re.form but this gave errors, although i am not quite sure I specified them correctly (I haven’t got the hang of nlmer group level specification).
Summary:
For stan_nlmer models, group specific terms are not being passed to posterior_predict.
Description:
I think I have encountered a possible error when trying to draw from the posterior predicted distribution of stan_nlmer models.
It appears that the group specific terms are not being passed to posterior_predict. In other words, it seems to behave as if re.form = NA and any predictions for groups end up drawn from the same posterior distribution. I have been able to replicate the problem using posterior_predict, add_predicted_draws etc.
The example below is drawn from the stan_nlmer vignette https://cran.r-project.org/web/packages/rstanarm/vignettes/glmer.html. If i repeat the example in the vignette and in the new data change the level for Tree to a within sample tree, it generates the same distribution of predicted values as for the out of sample tree. I also tried passing group level terms (e.g. Asy|Tree , ~1|Tree) direct to re.form but this gave errors, although i am not quite sure I specified them correctly (I haven’t got the hang of nlmer group level specification).
Thanks, Josh
Operating System:Windows10 rstanarm Version:2.21.1