marginalLikelihood_internal: Fast computation of the Normal-IW marginal likelihood.

Description Usage Arguments Normal-Inverse-Wishart model See Also

View source: R/RcppExports.R

Description

This is the numerator of the Bayes factor: assume that all observations come from the same source. To be called by the R wrapper.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
marginalLikelihood_internal(
  X,
  n_iter,
  B_inv,
  W_inv,
  U,
  nw,
  mu,
  burn_in,
  chain_output = FALSE,
  verbose = FALSE,
  Gibbs_only = FALSE
)

Arguments

X

the observation matrix ((n x p): n = observation, p = variables) @param U covariance matrix for the mean (p x p)

n_iter

number of MCMC iterations excluding burn-in

B_inv

prior inverse of between-source covariance matrix

W_inv

initialization for prior inverse of within-source covariance matrix

nw

degrees of freedom

mu

prior mean (p x 1)

burn_in

number of MCMC burn-in iterations

chain_output

if true, output the entire chain as a list (ML-value, samples from theta, samples from W_inv)

verbose

if TRUE, be verbose

Gibbs_only

if TRUE, only return the Gibbs posterior samples. Implies chain_output = TRUE.

Normal-Inverse-Wishart model

Described in \insertCiteBozza2008Probabilisticbayessource.

Observation level:

Group level:

Hyperparameters:

Posterior samples of theta, W^{(-1)} can be generated with a Gibbs sampler.

See Also

Other C++ functions: chol2inv(), diwishart_inverse(), dmvnorm(), inv_Cholesky_from_Cholesky(), inv_sympd_tol(), inv_triangular(), isCholeskyOn(), ldet_from_Cholesky(), logCummeanExp(), logCumsumExp(), logSumExpMean(), logSumExp(), rmvnorm(), rwish()

Other core functions: bayessource-package, get_minimum_nw_IW(), make_priors_and_init(), marginalLikelihood(), mcmc_postproc(), samesource_C(), two.level.multivariate.calculate.UC()


lgaborini/bayessource documentation built on Nov. 9, 2021, 2:10 p.m.