prepare_prior | R Documentation |
This extends brms::prior()
by
allowing just taking a numeric
value rather than constant(<value>)
to specify a constant prior
if brms::brmsprior is given, it checks that it has the specified arguments
This is used in building BayesPharma models to allow user specified priors but make sure they are for the right parameters to make sure the model is well specified.
prepare_prior(prior, ...)
prior |
brms::brmsprior or |
... |
additional arguments to |
brms::brmsprior
## Not run:
# user should specify a prior for hill, but they misspell it:
user_hill_prior <- brms::prior(
prior = normal(1, 1),
nlpar = "hilll",
ub = 0)
# in a script where we want to validate the user_hill_prior
hill_prior <- BayesPharma:::prepare_prior(
prior = user_hill_prior,
nlpar = "hill")
# gives an assert error that nlpar is not set correctly
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.