random numbers from custom mixture distribution
Afficher commentaires plus anciens
I would like to generate random numbers from a mixture distribution defined as,
pdf_mix = p*gampdf(x,a,b) + (1-p)*lognpdf(x,mu,sigma);
I am able to obtain the best fit model using mle, but I also want random numbers generated from this mixture distribution. Is this possible? Can I get some help on this?
R Venkatessh
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 6 Oct 2013
0 votes
Calculate the CDF and then get a random number from the uniform distribution and plug it in. See the method described here: http://en.wikipedia.org/wiki/Inverse_transform_sampling I've also attached my program for doing it with a rayleigh distribution. Click on the filename below (not the picture, but the filename).

Catégories
En savoir plus sur Random Number Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!