Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Gaussian mixture distribution

From   "ali hashemi" <>
To   <>
Subject   st: Gaussian mixture distribution
Date   Mon, 11 Jul 2011 17:51:30 -0400

Dear list members,

I would like to construct the density function of the following Gaussian
mixture distribution:

0.4 * N([3,-1], sigma1) + 0.6 * N([-1,1], sigma2)

Where sigma1 = [.2 -.1; -.1 .4] and sigma2 = [.3 .1; .1 .3]

I used the following lines to produce the density function:
bnormpdf x1 x2, m1(3) m2(-1) s1(.2) s2(.4) rho(-.1) dens(pdf1) double
bnormpdf x1 x2, m1(-1) m2(1) s1(.3) s2(.3) rho(.1) dens(pdf2) double
g p=uniform()<.4
g pdf = p*pdf1 + (1-p)*pdf2

Is this the right way to do it? Any advice? Is there any built-in command or
user-written program that can be used? 

Your help is very much appreciated


*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index