| prior {bayesplay} | R Documentation |
Specify a prior
Description
Define priors using different different distribution families
Usage
prior(family, ...)
Arguments
family |
the prior distribution (see details) |
... |
see details |
Details
Available distribution families
The following distributions families can be used for the prior
-
normala normal distribution -
student_ta scaled and shifted t-distribution -
cauchya Cauchy distribution -
uniforma uniform distribution -
pointa point -
betaa beta distribution The parameters that need to be specified will be dependent on the family
Normal distribution
When family is set to normal then the following
parameters may be be set
-
meanmean of the normal prior -
sdstandard deviation of the normal prior -
range(optional) a vector specifying the parameter range
Student t distribution
When family is set to student_t then the following
parameters may be set
-
meanmean of the scaled and shifted t prior -
sdstandard deviation of the scaled and shifted t prior -
dfdegrees of freedom of the scaled and shifted t prior -
range(optional) a vector specifying the parameter range
Cauchy distribution
When family is set to cauchy then the following
parameters may be set
-
locationthe centre of the Cauchy distribution (default: 0) -
scalethe scale of the Cauchy distribution -
range(optional) a vector specifying the parameter range
Uniform distribution
When family is set to uniform then the following
parameters must be set
-
minthe lower bound -
maxthe upper bound
Point
When family is set to point then the following
parameters may be set
-
pointthe location of the point prior (default: 0)
Beta
When family is set to beta then the following
parameters may be set
-
alphathe first shape parameter -
betathe second shape parameter
Value
an object of class prior
Examples
# specify a normal prior
prior(family = "normal", mean = 0, sd = 13.3)
# specify a half-normal (range 0 to Infinity) prior
prior(family = "normal", mean = 0, sd = 13.3, range = c(0, Inf))
# specify a student t prior
prior(family = "student_t", mean = 0, sd = 13.3, df = 79)
# specify a truncated t prior
prior(family = "student_t", mean = 0, sd = 13.3, df = 79, range = c(-40, 40))
# specify a cauchy prior
prior(family = "cauchy", location = 0, scale = .707)
# specify a half cauchy prior
prior(family = "cauchy", location = 0, scale = 1, range = c(-Inf, 0))
# specify a uniform prior
prior(family = "uniform", min = 0, max = 20)
# specify a point prior
prior(family = "point", point = 0)
# specify a beta prior
prior(family = "beta", alpha = 2.5, beta = 3.8)