Description Usage Arguments Normal-Inverse-Wishart model See Also
This is the numerator of the Bayes factor: assume that all observations come from the same source. To be called by the R wrapper.
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
)
|
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 |
Described in \insertCiteBozza2008Probabilisticbayessource.
Observation level:
X_{ij} ~ N_p(theta_i, W_i)
(i = source, j = items from source)
Group level:
theta_i ~ N_p(μ, B)
W_i ~ IW_p(n_w, U)
Hyperparameters:
B, U, n_w, μ
Posterior samples of theta, W^{(-1)} can be generated with a Gibbs sampler.
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.