Implemented in C.

samesource_C(
  quest,
  ref,
  n.iter,
  B.inv,
  W.inv.1,
  W.inv.2,
  U,
  nw,
  mu,
  burn.in,
  verbose = FALSE,
  marginals = FALSE
)

Arguments

quest

the questioned dataset (a \(n_q \times p\) matrix)

ref

the reference dataset (a \(n_r \times 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 \times 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)

Value

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

Details

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.

Normal-Inverse-Wishart model

Described in (Bozza et al. 2008) .

Observation level:

  • $$X_{ij} \sim N_p(\theta_i, W_i)$$ (i = source, j = items from source)

Group level:

  • $$\theta_i \sim N_p(\mu, B)$$

  • $$W_i \sim IW_p(\nu_w, U)$$

Hyperparameters:

  • $$B, U, \nu_w, \mu$$

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

Inverted Wishart parametrization (Press)

Uses (Press 2012) parametrization.

$$X \sim IW(\nu, S)$$ with \(S\) is a \(p \times p\) matrix, \(\nu > 2p\) (the degrees of freedom).

Then: $$E[X] = \frac{S}{\nu - 2(p + 1)}$$

References

Bozza S, Taroni F, Marquis R, Schmittbuhl M (2008). “Probabilistic Evaluation of Handwriting Evidence: Likelihood Ratio for Authorship.” Journal of the Royal Statistical Society: Series C (Applied Statistics), 57(3), 329-341. ISSN 1467-9876, doi: 10.1111/j.1467-9876.2007.00616.x .

Press SJ (2012). Applied Multivariate Analysis: Using Bayesian and Frequentist Methods of Inference. Courier Corporation.

See also