Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

eMixMargDen

Compute Marginal Densities of A Normal Mixture Averaged over MCMC Draws


Description

eMixMargDen assumes that a multivariate mixture of normals has been fitted via MCMC (using rnmixGibbs). For each MCMC draw, eMixMargDen computes the marginal densities for each component in the multivariate mixture on a user-supplied grid and then averages over the MCMC draws.

Usage

eMixMargDen(grid, probdraw, compdraw)

Arguments

grid

array of grid points, grid[,i] are ordinates for ith dimension of the density

probdraw

array where each row contains a draw of probabilities of the mixture component

compdraw

list of lists of draws of mixture component moments

Details

length(compdraw) is the number of MCMC draws.
compdraw[[i]] is a list draws of mu and of the inverse Cholesky root for each of mixture components.
compdraw[[i]][[j]] is jth component.
compdraw[[i]][[j]]$mu is mean vector.
compdraw[[i]][[j]]$rooti is the UL decomp of Σ^{-1}.

Value

An array of the same dimension as grid with density values.

Warning

This routine is a utility routine that does not check the input arguments for proper dimensions and type. To avoid errors, call with output from rnmixGibbs.

Author(s)

Peter Rossi, Anderson School, UCLA, perossichi@gmail.com.

References

For further discussion, see Bayesian Statistics and Marketingby Rossi, Allenby, and McCulloch.
http://www.perossi.org/home/bsm-1

See Also


bayesm

Bayesian Inference for Marketing/Micro-Econometrics

v3.1-4
GPL (>= 2)
Authors
Peter Rossi <perossichi@gmail.com>
Initial release
2019-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.