Learn R Programming

RoBMA (version 1.2.0)

prior: Creates a RoBMA prior

Description

prior creates a prior distribution for fitting a RoBMA model. The prior can be visualized by a plot function.

Usage

prior(
  distribution,
  parameters,
  truncation = list(lower = -Inf, upper = Inf),
  prior_odds = 1
)

Arguments

distribution

name of the prior distribution. The possible options are

"point"

for a point density characterized by a location parameter.

"normal"

for a normal distribution characterized by a mean and sd parameters.

"cauchy"

for a Cauchy distribution characterized by a location and scale parameters. Internally converted into a generalized t-distribution with df = 1.

"t"

for a generalized t-distribution characterized by a location, scale, and df parameters.

"gamma"

for a gamma distribution characterized by either shape and rate, or shape and scale parameters. The later is internally converted to the shape and rate parametrization

"invgamma"

for an inverse-gamma distribution characterized by a shape and scale parameters. The JAGS part uses a 1/gamma distribution with a shape and rate parameter.

"two.sided"

for a two-sided weight function characterized by a vector steps and vector alpha parameters. The alpha parameter determines an alpha parameter of Dirichlet distribution which cumulative sum is used for the weights omega.

"one.sided"

for a one-sided weight function characterized by either a vector steps and vector alpha parameter, leading to a monotonic one-sided function, or by a vector steps, vector alpha1, and vector alpha2 parameters leading non-monotonic one-sided weight function. The alpha / alpha1 and alpha2 parameters determine an alpha parameter of Dirichlet distribution which cumulative sum is used for the weights omega.

"uniform"

for a uniform distribution defined on a range from a to b

parameters

list of appropriate parameters for a given distribution.

truncation

list with two elements, lower and upper, that define the lower and upper truncation of the distribution. Defaults to list(lower = -Inf, upper = Inf). The lower truncation point is automatically set to 0 if it is specified outside of the support of distributions defined only for positive numbers.

prior_odds

prior odds associated with a given distribution. RoBMA() creates models corresponding to all combinations of prior distributions for each of the model parameters (mu, tau, omega), and sets the model priors odds to the product of its prior distributions.

See Also

plot.RoBMA.prior(), Normal, Cauchy, LocationScaleT, GammaDist, InvGamma.

Examples

Run this code
# NOT RUN {
# create a standart normal prior distribution
p1 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1))

# create a half-normal standart normal prior distribution
p2 <- prior(distribution = "normal", parameters = list(mean = 1, sd = 1),
truncation = list(lower = 0, upper = Inf))

# or a prior for one-sided weight function
p3 <- prior("one-sided", parameters = list(steps = c(.05, .10), alpha = c(1, 1, 1)))

# the prior distribution can be visualized using the plot function
# (see ?plot.prior.RoBMA for all options)
plot(p1)


# }

Run the code above in your browser using DataLab