Learn R Programming

bayesm (version 0.0-2)

rmixture: Draw from Mixture of Normals

Description

rmixture simulates iid draws from a Multivariate Mixture of Normals

Usage

rmixture(n, p, comps)

Arguments

n
number of observations
p
ncomp x 1 vector of prior probabilities for each mixture component
comps
list of mixture component parameters

Value

  • A list containing ...
  • xAn n x length(comps[[1]][[1]]) array of iid draws
  • zA n x 1 vector of indicators of which component each draw is taken from

concept

  • mixture of normals
  • simulation

Warning

This routine is a utility routine that does not check the input arguments for proper dimensions and type.

Details

comps is a list of length(ncomp) = length(p). comps[[j]][[1]] is mean vector for the jth component. comps[[j]][[2]] is the inverse of the cholesky root of Sigma for that component

See Also

rnmixGibbs