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

Normal distribution

When family is set to normal then the following parameters may be be set

Student t distribution

When family is set to student_t then the following parameters may be set

Cauchy distribution

When family is set to cauchy then the following parameters may be set

Uniform distribution

When family is set to uniform then the following parameters must be set

Point

When family is set to point then the following parameters may be set

Beta

When family is set to beta then the following parameters may be set

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)

[Package bayesplay version 0.9.3 Index]