Re: [R] sampling from a mixture distribution

From: Giovanni Petris <GPetris_at_uark.edu>
Date: Thu 24 Mar 2005 - 01:17:35 EST

For each variate, generate it from f1() with probability p1, and from f2() with probability p2. In other words, flip a p1-biased coin to decide which distribution, f1 or f2, to generate from.

HTH,
Giovanni

> Date: Wed, 23 Mar 2005 13:53:10 +0000
> From: Vumani Dlamini <dvumani@hotmail.com>
> Sender: r-help-bounces@stat.math.ethz.ch
> Precedence: list
>
> Dear R users,
> I would like to sample from a mixture distribution p1*f(x1)+p2*f(x2). I
> usually sample variates from both distributions and weight them with their
> respective probabilities, but someone told me that was wrong. What is the
> correct way?
> Vumani
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>

-- 

 __________________________________________________
[                                                  ]
[ Giovanni Petris                 GPetris@uark.edu ]
[ Department of Mathematical Sciences              ]
[ University of Arkansas - Fayetteville, AR 72701  ]
[ Ph: (479) 575-6324, 575-8630 (fax)               ]
[ http://definetti.uark.edu/~gpetris/              ]
[__________________________________________________]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu Mar 24 01:36:20 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:55 EST