Average pairwise overlap of a Gaussian mixture
Source:R/statistical_metrics.R
compute_average_overlap.RdReturns MixSim's BarOmega: the unweighted mean of pairwise
overlaps
$$
\overline{\omega}
=
\frac{2}{J(J-1)}
\sum_{1\le j<\ell\le J}
\bigl(\Omega_{j\ell}+\Omega_{\ell j}\bigr)
\in[0,1]
$$
(up to the MixSim numerical convention), where
\(\Omega_{j\ell}=\Pr_{X\sim f_j}(X\text{ classified as }\ell)\)
already uses the mixture weights \(\boldsymbol{p}\) inside the
Bayes / MAP rule of MixSim::overlap(). Do not multiply the
directional masses by \(p_j\) again.
For \(G\ge 4\) MixSim's Davies quadrature becomes expensive.
The helper then switches to overlap_gaussian_mc(): stratified
Sobol draws, inverse-transform sampling through precomputed
Cholesky factors, and log-density MAP comparisons (n_mc
draws per component; default 10,000).
Arguments
- true_theta
List validated by
check_true_theta():p(length \(J\) or \(J\times N\)),mu(\(G\times J\)),sigma(\(G\times G\times J\)).- J
Number of cell types (components). Defaults to the third dimension of
sigma.- n_mc
Monte Carlo draws per component when \(G\ge 4\).
- seed
Optional seed forwarded to
overlap_gaussian_mc().- verbose
If
TRUE(default), announce the MixSim-to-MC switch withcliwhen it is installed.