Skip to contents

Convert Gaussian mixture model to a distributional object

Usage

dist_mclust(object)

Arguments

object

Object of class Mclust, output from the [mclust::Mclust] function

Value

An object of class distributional

Examples

library(mclust, exclude = "count")
#> Package 'mclust' version 6.1.4
#> Type 'citation("mclust")' for citing this R package in publications.
# Univariate mixture density
gmm <- Mclust(oldfaithful$duration) |> dist_mclust()
gg_density(gmm) +
  geom_jitter(data = oldfaithful, aes(x=duration, y = -0.0002),
    width=0, height=0.0002, alpha = 0.1) +
  labs(x = "Eruption duration", y = "")