nix2_marginal_lhood: Marginal likelihood function

Description Usage Arguments Details Value

View source: R/nix.R

Description

Compute the marginal likelihood of data given NIX^2 prior, or p(x) = \int \mathrm d σ_2 \mathrm dμ p(x | μ, σ^2) p(μ, σ^2).

Usage

1
2
nix2_marginal_lhood(p, x = NA, n = length(x), xbar = mean(x),
  ss = s2 * (n - 1), s2 = var(x), log = FALSE)

Arguments

p

named list of distribution parameters (mu, sigma2, nu, and kappa)

x

vector of observations to update with (optional if summary stats are passed)

n

number of observations (overrides x)

xbar

observed mean (overrides x)

ss

observed sum of squares (overrides x and s2)

s2

observed sample variance (ss / (n-1); overrides x)

log

Default FALSE.

Details

Based on equation 171 from Murphy (2008; University of British Columbia).

Value

The overal marginal likelihood of all the observations x (or summary statistics if provided).


kleinschmidt/beliefupdatr documentation built on May 24, 2020, 8:26 p.m.