Skip to contents

Number of components in a Gaussian mixture

Usage

gmm_n_components(x)

Arguments

x

A gmm (or gmm_fit) object.

Value

Integer scalar.

Examples

g <- gmm(weights = c(0.5, 0.5), means = list(c(0, 0), c(1, 1)),
         covariances = list(diag(2), diag(2)))
gmm_n_components(g)
#> [1] 2