Skip to contents

A gmm_fit is the result of fit_proxymix() (or one of the regime-specific fitters). It inherits the mixture parameters of gmm and adds a record of the target it was fitted to, the regime used, and the iteration diagnostics.

Usage

gmm_fit(
  weights = numeric(0),
  means = list(),
  covariances = list(),
  name = "gmm",
  metadata = list(),
  target = NULL,
  regime = NA_character_,
  diagnostics = list(),
  converged = NA,
  iterations = NA_integer_,
  call = NULL
)

Arguments

weights, means, covariances, name, metadata

See gmm.

target

The gmm_target the mixture was fitted to.

regime

One of "moment", "sample", "kld".

diagnostics

A list of regime-specific diagnostics (see kld_trace(), ess_trace()).

converged

Logical scalar.

iterations

Integer scalar.

call

The matched call.

Value

An S7 object inheriting from gmm_fit (and gmm).

Examples

samples <- matrix(stats::rnorm(200), ncol = 2)
tgt <- gmm_target_from_samples(samples)
fit <- fit_proxymix(tgt, N = 2L, regime = "sample", max_iter = 25L)
inherits(fit, "proxymix::gmm_fit")
#> [1] TRUE