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

setting prior fails if there are no fixed parameters in the model #170

Closed
venpopov opened this issue Mar 22, 2024 · 1 comment · Fixed by #172
Closed

setting prior fails if there are no fixed parameters in the model #170

venpopov opened this issue Mar 22, 2024 · 1 comment · Fixed by #172
Assignees
Labels
bug Something isn't working
Milestone

Comments

@venpopov
Copy link
Owner

After #152, a new bug appears if we try to predict all parameters of a model and none are left fixed:

formula <- bmf(mu ~ 1,
               c ~ 1,                
               kappa ~ 1)   
default_prior(formula, OberauerLin_2017, sdmSimple('dev_rad'))
Error: Processing arguments of 'set_prior' has failed:
Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE,  : 
  arguments imply differing number of rows: 0, 1

If at least one parameter is fixed to a constant it works fine:

formula <- bmf(mu ~ 1,
               c ~ 1,                
               kappa = 2)   
default_prior(formula, OberauerLin_2017, sdmSimple('dev_rad'))

This is caused by the "fixed_pars_priors", which throws an error if there are no fixed parameters. We should add a condition to execute this only if fixed parameters exist

@venpopov venpopov self-assigned this Mar 22, 2024
@venpopov venpopov added the bug Something isn't working label Mar 22, 2024
@venpopov venpopov added this to the 1.0.0 milestone Mar 22, 2024
@venpopov
Copy link
Owner Author

I have already fixed this on the bugfix branch, but I noticed that we don't have a default prior for mu, and that if users predict mu, it gets the default brms prior, which turns out it's quite strange for the von_mises distributions - paul-buerkner/brms#1631

Before adding a pull request, I will see if I can add default priors for the mu parameters in our models. I suspect this might require some adjustments to ensure that they do not overwrite the constant priors when they are fixed by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant