Computes the marginal distribution of a Gaussian mixture over a subset of coordinates. The marginal of a Gaussian mixture is itself a Gaussian mixture with the same weights.
Value
A gmm object in dimension length(keep).
See also
Other ops:
dgmm(),
gmm_canonicalise(),
gmm_conditionalise(),
gmm_divergence(),
gmm_kld(),
gmm_mean(),
gmm_modes(),
pgmm(),
rgmm()
Examples
g <- gmm(weights = c(0.5, 0.5),
means = list(c(-1, 0, 2), c(1, 0, -2)),
covariances = list(diag(3), diag(3)))
gmm_marginalise(g, keep = c(1L, 3L))
#> <marginalise(gmm)>: K = 2 components in p = 2 dimensions
#> [1] w = 0.5000, |mu| = 2.2361, tr(Sigma) = 2.0000
#> [2] w = 0.5000, |mu| = 2.2361, tr(Sigma) = 2.0000