pickNormalMix: Simulate a mixture of normal distributions

Description Usage Arguments Value Author(s) Examples

Description

Helper function to simulate the normal mixtures with varying hyperparameters (means and variances).

Usage

1
2
pickNormalMix(N, nMix = NULL, propMix = NULL, muMix = NULL,
  sigMix = NULL)

Arguments

N

number of observations to simulate from the mixture of normals

nMix

number of mixtures. Default is 3.

propMix

mixture proportions. If NULL (default), a mixture distribution with propMix = c(0.4, 0.2, 0.4) is simulated. Otherwise user must supply propMix. Length should equal nMix.

muMix

mean of nMix distributions. If NULL (default), a mixture distribution with muMix = c(-3, 1, 3) is simulated. Otherwise user must supply propMix. Length should equal nMix.

sigMix

variance of nMix distributions. If NULL (default), a mixture distribution with sigMix = c(3, .4, 3) is simulated. Otherwise user must supply sigMix. Length should equal nMix.

Value

A list with elements

trueParams

A data frame with the input parameters used to simulate the mixture distribution (propMix, muMix and sigMix)

simObs

A data frame containing trueMix (indicator specifying which distribution the observation came from) and normObs (the observed value from the mixture distribution).

Author(s)

Stephanie Hicks

Examples

1
pickNormalMix(N = 10)

stephaniehicks/quantroSim documentation built on May 30, 2019, 3:17 p.m.