-
Notifications
You must be signed in to change notification settings - Fork 63
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
predicted_draws for a brms model does not bring in .chain or .iteration #301
Comments
Yes, this is because posterior_predict() for those models does not return chain/iteration information. In some cases this could be retrofitted onto the resulting object, though I'm not sure it can be done in all cases (eg with subsampling). Since there wasn't a generic solution I was sure worked for all parameters that might be passed down to these functions, I opted not to include that information in case it would be wrong in some cases. I'm willing to be convinced otherwise if there's a reliable solution. If you are using the full set of draws (no subsampling), I believe |
Thanks for the clarification, I had not considered the issues around It seems like some of the issue is that With all of that said it does seem like it would be possible to provide the .chain and .iteration information in cases where The formulas provided above make sense to me but seems potentially fragile if there was ever any weirdness around ordering vs. just using posterior + the brmsfit object to fill in the blanks. |
One other quick though I just had - in the case of In the case of |
Not a bad idea. This could be a good way to handle random subsets as well, rather than the current method which may be fragile in some cases. |
I'm going to attempt a fix for this. I haven't dug in deep yet, but please let me know @mjskay if anything fundamental has changed since the past comments. Otherwise I'll proceed with the above! Thanks. |
Sure, would love a fix! I'd probably double check with @paul-buerkner to see if there's a canonical way to get chain and iteration info out of |
I think this is related to paul-buerkner/brms#1534. We likely have to wait until brms 3.0 for this feature. |
Makes sense, thank you @paul-buerkner. We have some code that's a bit of a workaround ( see below), I assume the preference is waiting until brms 3.0 rather than a temporary fix in
|
My expectation is that
predicted_draws()
and related functions should be including the.chain
and.iteration
details from the model but currently they are justNA
. The values can be recovered via a join but it is a bit of a headache and involves an unnecessarygather_draws()
or similar.See the reprex below,
This also appears to be the case with models from rstanarm as well.
The text was updated successfully, but these errors were encountered: