-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
fixing mu parameter via mu = some_value? #1597
Comments
Let me look into this. Just a note that the contant() prior approach is actually the newer one while the bf(par = value) approach is much older and I am not even sure I like having the latter version in brms at all or if I may want to deprecate it at some point. |
Didn't realize the order, I guess it was newer because I never knew it was possible that way. I like it because it is clearer and shorter. Terms with ~ are estimated, terms with = are fixed, but both are part of the model specification. The constant(value) prior is not really coded as a prior in the underlying Stan code that brms generates, but rather just a fixed variable with that value, which to me is more consistent with the formula approach. But I understand if you prefer the prior approach and decide to deprecated the otherr |
Currently there are two ways to fix model parameters to a constant. The older one is via a constant prior, and this works for any parameter:
The newer method is to specify par = some_value, e.g.:
I find the newer method much more intuitive and it is easier and faster to write. Unfortunately, while the first method works for any parameter, including
mu
, the second only works for non-mu parameters. For example this:does not work. The model runs, but mu=0 is ignored and an intercept is still estimated.
Interestingly, if we want to fix it to 0 specifically, both of these work:
resulting in:
I suspect this is not intentional - supressing the intercept results in stan code in which mu is not part of the parameter block, but we have
Nevertheless, it works. But only for the specific case of fixing
mu=0
.Is it possible to allow fixing mu to an arbitrary value via the formula syntax as for other parameters?
The text was updated successfully, but these errors were encountered: