simulate_univariate_GMM: Generation of a mixture drawn from an univariate GMM, with...

View source: R/mixture.R

simulate_univariate_GMMR Documentation

Generation of a mixture drawn from an univariate GMM, with possibility to add outliers

Description

Generation of a mixture drawn from an univariate GMM, with possibility to add outliers

Usage

simulate_univariate_GMM(
  theta = list(p = c(0.4, 0.6), mu = c(175, 165), sigma = c(10, 12)),
  n = 100,
  prop_outliers = 0,
  interval = 2
)

simulate_multivariate_GMM(theta, n = 500)

Arguments

theta

a list with 3 entries:

  • The proportions p: p of each component (must be included between 0 and 1, and sum to one overall)

  • The mean matrix mu: \mathrm{\mu}=(\mu_{i,j}) \in \mathbb{R}^{n \times k}, with each column giving the mean values of the variables within a given component

  • The 3-dimensional covariance matrix array Sigma: \mathrm{\Sigma}=(\Sigma_{i,j,l}) \in \mathbb{R}^{n \times n \times k}, with each matrix \Sigma_{..l}, l \in \{ 1, \ldots, k\} storing the covariance matrix of a given component, whose diagonal terms correspond to the variance of each variable, and off-terms diagonal elements return the covariance matrix

n

the number of observations to be drawn

prop_outliers, interval

first argument is the proportion of outliers, drawn from an uniform distribution whose intervals are defined by the second argument twice the distance between the 0.05 and 0.95 quantile of the distribution

Details

We do not implement the possibility of adding outliers in the multivariate context

Value

Depending on the univariate or multivariate context:

  • a list with the number of components k, the true parameters p, mu, sigma, the observed variables x, the hidden observations s and an indicator of the outliers s_outliers

  • a list with the number of components k, the true parameters p, mu, sigma, the observations X living in space \mathbb{R}^k, the hidden indicator variables s (vector of size n)

Author(s)

Bastien CHASSAGNOL


bastienchassagnol/RGMMBench documentation built on Oct. 26, 2023, 5:58 p.m.