-
-
Notifications
You must be signed in to change notification settings - Fork 181
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
feature request – predict.brms: allow new values for random effects fit with splines #1554
Comments
Definitely. This feature would be extremely helpful! |
Can you post a minimal reproducible example here to explain what you have in mind? |
My model takes several weeks to run so it's likely more efficient if I privately send you the fit model as well as the data I would like to predict on. Would this be okay? But, so others who view this post have an idea of the situation, I have trained the following model with 70% of my data:
where y = a binomial response (1,0) What I would now like to do is predict on the remaining 30% of data using |
perhaps you can post a simple version of your model on simulated data here
that only contains the core aspects relevant for this feature? I won't be
able to run the model for several weeks either :-D
Kathrine Stewart ***@***.***> schrieb am Mo., 30. Okt. 2023,
08:07:
… Reopened #1554 <#1554>.
—
Reply to this email directly, view it on GitHub
<#1554 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADCW2AHD6ZTDFIPK3NICGN3YB5G3PAVCNFSM6AAAAAA6S7TKWWVHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQHAYDGNBRG4ZTGMI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Apologies, it took me some time to figure out how to simulate data that captures the core features of my actual data set, but please find below a minimally reproducible example. The model was run with
When I run the prediction, I get the error: Please find attached a zip file with the model object. Let me know if you have any issues opening it or need anything else. Cheers! |
Thank you! This is way for detailed than I expected. I would have been happy with a much simpler example, but this of course works well too. I will take a look. |
Great, thank-you. I really appreciate it. |
I have also encountered multiple occasions recently where this feature would be extremely beneficial. Would be much appreciated if it could be implemented in the next release! |
The predict.brmsfit() function includes an argument allow_new_levels, which allows one to predict on new data containing group levels that were not present in the original data used to fit the model. However, this functionality does not extend to models whose random effects are fit with splines (as stated in the comments section of this post: https://discourse.mc-stan.org/t/predict-error-with-nested-random-effect-structure/4817/13).
If I understand correctly, the work-around for this issue is to re-run the model without a spline on the random effect. However, in some cases, this is not an ideal situation (e.g., when someone is explicitly interested in explicitly modelling the non-linear effects of group levels). For me, personally, I would much prefer to keep the splines on my random effects. Thus, is it possible to add this functionality to the predict function?
The text was updated successfully, but these errors were encountered: