bimodal distribution [message #73564] |
Fri, 19 November 2010 10:22  |
Giuseppe Papa
Messages: 27 Registered: February 2010
|
Junior Member |
|
|
I'm trying to simulate a bimodal "randomn" distribution with the 2 peaks having the sigmas of 0.3 each for example and mean around -1.2 and -0.7...
Do you have any tips?
I've tried adding these below, but it doesn't work..., I get a unimodal distribution...
met_1a = randomn(seed,100000)*0.3-1.2
met_1b = randomn(seed,100000)*0.3-0.7
I hope you can help me...
Cheers
|
|
|
Re: bimodal distribution [message #73750 is a reply to message #73564] |
Tue, 23 November 2010 13:25  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Dick Jackson writes:
> I think these do give a bimodal distribution, but they overlap a lot.
> This might help, separating them by an extra two units:
>
> met_1a = randomn(seed,100000)*0.3-1.2 -1
> met_1b = randomn(seed,100000)*0.3-0.7 +1
> plot,histogram([met_1a,met_1b],binsize=0.1),psym=10
>
> Note: the X axis is off here, as you need to wrestle with Histogram()
> and Plot() to get them right, but I think this makes the point.
No wrestling needed with Histoplot. :-)
IDL> Histoplot,[met_1a,met_1b], Binsize=0.1
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: bimodal distribution [message #73751 is a reply to message #73564] |
Tue, 23 November 2010 13:09  |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
Hi, ...
I think these do give a bimodal distribution, but they overlap a lot.
This might help, separating them by an extra two units:
met_1a = randomn(seed,100000)*0.3-1.2 -1
met_1b = randomn(seed,100000)*0.3-0.7 +1
plot,histogram([met_1a,met_1b],binsize=0.1),psym=10
Note: the X axis is off here, as you need to wrestle with Histogram()
and Plot() to get them right, but I think this makes the point.
Cheers,
-Dick
Dick Jackson Software Consulting
http://www.d-jackson.com
chiessantos wrote:
> I'm trying to simulate a bimodal "randomn" distribution with the 2 peaks having the sigmas of 0.3 each for example and mean around -1.2 and -0.7...
> Do you have any tips?
>
> I've tried adding these below, but it doesn't work..., I get a unimodal distribution...
> met_1a = randomn(seed,100000)*0.3-1.2
> met_1b = randomn(seed,100000)*0.3-0.7
>
> I hope you can help me...
> Cheers
>
>
>
|
|
|