[R] sampling from a mixture distribution

Vumani Dlamini dvumani at hotmail.com
Wed Mar 23 14:53:10 CET 2005


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




More information about the R-help mailing list