RBesT (version 1.7-3)

likelihood: Read and Set Likelihood to the Corresponding Conjugate Prior

Description

Read and set the likelihood distribution corresponding to the conjugate prior distribution.

Usage

likelihood(mix)

likelihood(mix) <- value

Arguments

mix

Prior mixture distribution.

value

New likelihood. Should only be changed for Gamma priors as these are supported with either Poisson (value="poisson") or Exponential (value="exp") likelihoods.

Supported Conjugate Prior-Likelihood Pairs

Prior/PosteriorLikelihoodPredictiveSummaries
BetaBinomialBeta-Binomialn, r
NormalNormal (fixed \(\sigma\))Normaln, m, se
GammaPoissonGamma-Poissonn, m
GammaExponentialGamma-Exp (not supported)n, m

Details

If the prior and posterior distributions are in the same family, then the prior distribution is called a conjugate prior for the likelihood function.

Examples

Run this code

# Gamma mixture
gmix <- mixgamma(c(0.3, 20, 4), c(0.7, 50, 10))

# read out conjugate partner
likelihood(gmix)

ess(gmix)

# set conjugate partner
likelihood(gmix) <- "exp"

# ... which changes the interpretation of the mixture
ess(gmix)

Run the code above in your browser using DataLab