Description Usage Arguments Details Examples
Define a normal prior used for estimation
1 | normal_prior(mean = 0, sd = 5, defaultMean = 0, defaultSD = 5)
|
mean |
a vector of prior means |
sd |
a vector of prior standard deviations |
defaultMean |
a (scalar) default mean for all elements not defined in |
defaultSD |
a (scalar) default standard deviation for all elements not defined in |
This function should never be used on its own, but only for the prior
argument of
gibbs
. The default uses a weakly informative prior.
Both arguments mean
and sd
are either unnamed vectors of length
1, or named vectors that may contain up to three elements: gamma
, beta
, or
beta1
, and beta2
. If the vector is unnamed, then the value applies to all sets of
parameters. If it is named, it applies to the set of named parameters (the name beta
applies
to both beta1
and beta2
parameters). If some parameter is not defined, then the
corresponding default*
argument is used as a fallback.
1 2 3 4 5 6 7 8 9 10 | # default
normal_prior()
# change the default mean and sd for all parameters
normal_prior(1, 2)
# change the default mean for gamma, and use a different fallback mean
normal_prior(mean = c("gamma" = 1), defaultMean = 2)
# change the default mean for both beta1 and beta2
normal_prior(mean = c("beta" = 2))
# change the default mean for all parameters
normal_prior(mean = c("gamma" = 1, "beta1" = 2, "beta2" = 3))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.