Learn R Programming

RegimeChange (version 0.1.1)

normal_gamma: Normal-Gamma Prior for Unknown Mean and Variance

Description

Creates a Normal-Gamma prior specification for data with unknown mean and variance. This is conjugate for normal observations.

Usage

normal_gamma(mu0 = 0, kappa0 = 1, alpha0 = 1, beta0 = 1)

Value

An object of class "regime_prior"

Arguments

mu0

Prior mean for the mean parameter

kappa0

Prior pseudo-observations for the mean (strength of prior)

alpha0

Shape parameter for the precision (inverse variance)

beta0

Rate parameter for the precision

Details

The Normal-Gamma prior places a joint distribution on (mu, tau) where tau = 1/sigma^2:

tau ~ Gamma(alpha0, beta0) mu | tau ~ Normal(mu0, 1/(kappa0 * tau))

The prior mean of mu is mu0, and the prior mean of sigma^2 is beta0/(alpha0-1) for alpha0 > 1.

Examples

Run this code
prior <- normal_gamma()

prior <- normal_gamma(mu0 = 0, kappa0 = 10, alpha0 = 3, beta0 = 2)

Run the code above in your browser using DataLab