Condition a Gaussian mixture on the exact values of some coordinates
Source:R/operator_calculus.R
gmm_missing.RdA structured wrapper around gmm_conditionalise() for the common case
where the observed coordinates are specified by integer index rather
than NA-padded vector. Equivalent to gmm_observe() with a
selection matrix A and zero noise covariance, but routed through
the Schur-complement path for efficiency.
Value
A gmm in R^(p - length(observed)).
See also
Other operators:
gmm_affine(),
gmm_aggregate(),
gmm_convolve(),
gmm_counterfactual(),
gmm_filter(),
gmm_intervene(),
gmm_mix(),
gmm_observe(),
gmm_product(),
gmm_reduce()
Examples
g <- gmm(weights = c(0.4, 0.6),
means = list(c(-1, 0), c(1, 0)),
covariances = list(diag(2), diag(2)))
# Condition coord 2 on the value 0.5; keep coord 1.
gmm_missing(g, observed = 2L, values = 0.5)
#> <missing(gmm)>: K = 2 components in p = 1 dimensions
#> [1] w = 0.4000, |mu| = 1.0000, tr(Sigma) = 1.0000
#> [2] w = 0.6000, |mu| = 1.0000, tr(Sigma) = 1.0000