Skip to contents

A named alias for gmm_affine() when A is a (row-wise) aggregation matrix — e.g. a block-sum, block-average, or unequal-weight aggregation used in downscaling pipelines. The mathematics is identical to gmm_affine(); the alias gives the public API a clearer hook for aggregation-specific diagnostics in later releases.

Usage

gmm_aggregate(g, A, noise_cov = NULL, ridge_eps = 1e-06)

Arguments

g

A gmm (or gmm_fit) in R^p.

A

An m by p numeric matrix.

noise_cov

Optional m by m SPD numeric matrix. Default NULL (deterministic aggregation).

ridge_eps

Tiny ridge added to the output covariances for numerical hygiene.

Value

A gmm in R^m.

Examples

g <- gmm(weights = c(0.5, 0.5),
         means = list(c(-1, 0, 1), c(1, 0, -1)),
         covariances = list(diag(3), diag(3)))
# Sum coordinates 1 and 2 into a single aggregate; pass coord 3 through.
A <- matrix(c(1, 1, 0,
              0, 0, 1), nrow = 2L, byrow = TRUE)
gmm_aggregate(g, A)
#> <aggregate(gmm)>: K = 2 components in p = 2 dimensions
#>   [1] w = 0.5000, |mu| = 1.4142, tr(Sigma) = 3.0000
#>   [2] w = 0.5000, |mu| = 1.4142, tr(Sigma) = 3.0000