Description Usage Arguments Details Value Normal-Inverse-Wishart model Inverted Wishart parametrization (Press) References See Also
View source: R/samesource_cpp.R
Implemented in C.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | samesource_C(
quest,
ref,
n.iter,
B.inv,
W.inv.1,
W.inv.2,
U,
nw,
mu,
burn.in,
verbose = FALSE,
marginals = FALSE
)
|
quest |
the questioned dataset (a n_q x p matrix) |
ref |
the reference dataset (a n_r x p matrix) |
n.iter |
number of MCMC iterations excluding burn-in |
B.inv |
prior inverse of between-source covariance matrix |
W.inv.1 |
prior inverse of within-source covariance matrix (questioned items) |
W.inv.2 |
prior inverse of within-source covariance matrix (reference items) |
nw |
degrees of freedom |
mu |
prior mean (p x 1) |
burn.in |
number of MCMC burn-in iterations |
verbose |
if TRUE, be verbose |
marginals |
if TRUE, also return the marginal likelihoods in the LR formula (default: FALSE) |
The hypothesis pair is:
H_p: all ref
and quest
come from the same source
H_p: quest
comes from source 1, ref
comes from source 2
See diwishart_inverse
for the parametrization of the Inverted Wishart.
See marginalLikelihood_internal
for further documentation.
the log-BF value (base e), or a list with the log-BF and the computed marginal likelihoods:
value
: the log-BF value (base e)
log_ml_Hp
: log-BF numerator (from reference = questioned source)
log_ml_Hd_ref
: log-BF denominator from reference source
log_ml_Hd_quest
: log-BF denominator from questioned (!= reference) source
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.
Uses \insertCitePress2012Appliedbayessource parametrization.
X ~ IW(v, S)
with S is a p x p matrix, v > 2p (the degrees of freedom).
Then:
E[X] = S/(n - 2(p + 1))
marginalLikelihood
Other core functions:
bayessource-package
,
get_minimum_nw_IW()
,
make_priors_and_init()
,
marginalLikelihood_internal()
,
marginalLikelihood()
,
mcmc_postproc()
,
two.level.multivariate.calculate.UC()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.