prior | R Documentation |
prior
creates a prior distribution.
The prior can be visualized by the plot
function.
prior(
distribution,
parameters,
truncation = list(lower = -Inf, upper = Inf),
prior_weights = 1
)
distribution |
name of the prior distribution. The possible options are
|
parameters |
list of appropriate parameters for a given
|
truncation |
list with two elements, |
prior_weights |
prior odds associated with a given distribution. The value is passed into the model fitting function, which creates models corresponding to all combinations of prior distributions for each of the model parameters and sets the model priors odds to the product of its prior distributions. |
prior
and prior_none
return an object of class 'prior'.
A named list containing the distribution name, parameters, and prior weights.
plot.prior()
, Normal, Lognormal, Cauchy,
Beta, Exponential,
LocationScaleT, InvGamma.
# create a standard normal prior distribution
p1 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1))
# create a half-normal standard normal prior distribution
p2 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1),
truncation = list(lower = 0, upper = Inf))
# the prior distribution can be visualized using the plot function
# (see ?plot.prior for all options)
plot(p1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.