normal_prior: Define a normal prior used for estimation

Description Usage Arguments Details Examples

View source: R/prior.R

Description

Define a normal prior used for estimation

Usage

1
normal_prior(mean = 0, sd = 5, defaultMean = 0, defaultSD = 5)

Arguments

mean

a vector of prior means

sd

a vector of prior standard deviations

defaultMean

a (scalar) default mean for all elements not defined in mean

defaultSD

a (scalar) default standard deviation for all elements not defined in sd

Details

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.

Examples

 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))

rferrali/rogali documentation built on May 26, 2019, 7 p.m.