Skip to content
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

lprior not available if normalize = FALSE #1672

Closed
n-kall opened this issue Jul 15, 2024 · 3 comments
Closed

lprior not available if normalize = FALSE #1672

n-kall opened this issue Jul 15, 2024 · 3 comments

Comments

@n-kall
Copy link

n-kall commented Jul 15, 2024

Currently, specifying normalize = FALSE will define the lprior in the model block, so it is not returned in the fit (resulting in priorsense giving an error). At the least, this could be added to the documentation (such as is done for bridge sampling).

Alternatively, maybe the lprior could be created in the generated quantities using the normalized *_lpdf functions in this case.

@n-kall
Copy link
Author

n-kall commented Jul 15, 2024

We could also provide an error message pointing to normalize = TRUE in the priorsense helper functions when the lprior is not available

@paul-buerkner
Copy link
Owner

Thanks! Since the _lupdf functions are not allowed in the transformed parameters block for some reason, lprior would have to be regenerated in generated quantites but that seems like excessive effort. The speedup from using the unnormalized functions is usually small and I think that it is easiest to just have an informative error that points to lprior not being saved because normalize was FALSE. I will update this in the next patch of brms.

@paul-buerkner paul-buerkner added this to the brms 2.22.0 milestone Jul 15, 2024
paul-buerkner added a commit that referenced this issue Sep 12, 2024
@paul-buerkner
Copy link
Owner

Fixed :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants