[R] Bimodal Distribution

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Fri May 30 01:53:16 CEST 2008


Hi Mike,

if you can decompose the bimodal distribution into (eg two) known
forms, then you could try a stepwise approach, eg:

If uniform < 0.5 then double it and use it to draw from the inverse
cdf of  A,

else, double (uniform - 0.5) and use it to draw from the inverse cdf of B.

You can change the cutoff and the weights to suit your need.  It's
best to double-check by plotting an empirical density of the numbers
generated. 

I hope that this helps,

Andrew

On Thu, May 29, 2008 at 04:05:29PM -0600, Mike Williams wrote:
> Hello R Users,
> 
> I am doing a Latin Hypercube type simulation. I have found the 
> improvedLHS function and have used it to generate a bunch of properly 
> distributed uniform probabilities. Now I am using functions like qlnorm 
> to transform that into the appropriately lognormal or triangularly 
> distributed parameters for my modes. However I have a parameter which I 
> believe is bimodally distributed, could someone please point me at an 
> appropriate function equivalent to qlnorm which I can use, because for 
> some reason I have been unable to find one. It occurs to me that maybe 
> one doesn't exist, in which case could someone give me some other idea 
> of how to accomplish this goal?
> 
> Thanks,
> 
> Mike
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Department of Mathematics and Statistics            Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia         Fax: +61-3-8344-4599
http://www.ms.unimelb.edu.au/~andrewpr
http://blogs.mbs.edu/fishing-in-the-bay/



More information about the R-help mailing list