measrprior | R Documentation |
Create prior definitions for classes of parameters, or specific parameters.
measrprior(
prior,
class = c("structural", "intercept", "maineffect", "interaction", "slip", "guess"),
coef = NA,
lb = NA,
ub = NA
)
prior(prior, ...)
prior_(prior, ...)
prior_string(prior, ...)
prior |
A character string defining a distribution in Stan language. A list of all distributions supported by Stan can be found in Stan Language Functions Reference at https://mc-stan.org/users/documentation/. |
class |
The parameter class. Defaults to |
coef |
Name of a specific parameter within the defined class. If not defined, the prior is applied to all parameters within the class. |
lb |
Lower bound for parameter restriction. Defaults to no restriction. |
ub |
Upper bound for parameter restriction. Defaults to no restriction. |
... |
Additional arguments passed to |
A tibble of class measrprior
.
prior()
: Alias of measrprior()
which allows arguments to be
specified as expressions without quotation marks.
prior_()
: Alias of measrprior()
which allows arguments to be
specified as one-sided formulas or wrapped in base::quote()
.
prior_string()
: Alias of measrprior()
which allows arguments to be
specified as character strings.
# Use alias functions to define priors without quotes, as formulas,
# or as character strings.
(prior1 <- prior(lognormal(0, 1), class = maineffect))
(prior2 <- prior_(~lognormal(0, 1), class = ~maineffect))
(prior3 <- prior_string("lognormal(0, 1)", class = "maineffect"))
identical(prior1, prior2)
identical(prior1, prior3)
identical(prior2, prior3)
# Define a prior for an entire class of parameters
prior(beta(5, 25), class = "slip")
# Or for a specific item (e.g., just the slipping parameter for item 7)
prior(beta(5, 25), class = "slip", coef = "slip[7]")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.