Learn R Programming

lestat (version 1.9)

normalgamma: A Normal-Gamma Distribution

Description

Creates an object representing a Normal-Gamma distribution. If \((x,y)\) has a Normal-Gamma distribution, then the marginal distribution of \(y\) is a Gamma distribution, and the conditional distribution of \(x\) given \(y\) is normal.

Usage

normalgamma(mu, kappa, alpha, beta)

Arguments

mu

The mu parameter.

kappa

The kappa parameter.

alpha

The alpha parameter.

beta

The beta parameter.

Value

A Normal-Gamma probability distribution.

Details

If \((x,y)\) has a Normal-Gamma distribution with parameters \(\mu\), \(\kappa\), \(\alpha\), and \(\beta\), then the marginal distribution of \(y\) has a Gamma distribution with parameters \(\alpha\) and \(\beta\), and conditionally on \(y\), \(x\) has a normal distribution with expectation \(\mu\) and logged standard deviation \(\kappa - log(y)/2\). The probability density is proportional to $$ f(x,y)=y^{\alpha-0.5}\exp(-y(\beta + e^{-2\kappa}(x-\mu)^2/2)) $$

See Also

gamma, normal, expgamma, normalexpgamma, mnormal, mnormalgamma, mnormalexpgamma

Examples

Run this code
# NOT RUN {
plot(normalgamma(3,4,5,6))
# }

Run the code above in your browser using DataLab