Re: idl bimodal distribution [message #73562] |
Fri, 19 November 2010 10:32  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Nov 19, 4:24 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Nov 19, 4:14 pm, Ana <u...@compgroups.net/> 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
>
>> Can someone help?
>
> Maybe I misunderstood it, but is this not a result of the central
> limit theorem?
If you want two peaks, it seems that you want the concatenation, not
the addition of the two distributions. Still, the distance between the
peaks will have to be large compared to the sum of their standard
deviations.
|
|
|
|
Re: idl bimodal distribution [message #73706 is a reply to message #73562] |
Fri, 19 November 2010 15:42  |
Robin Wilson
Messages: 40 Registered: August 2010
|
Member |
|
|
On 19/11/2010 18:32, Paulo Penteado wrote:
>>> 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
Just to complete the answer with an example. You could concatenate those
arrays by doing:
bimodal_dist = [met_1a, met_1b]
As Paula stated, you may need a larger distance between your peaks to
get a noticeably bimodal distribution.
Best regards,
Robin
|
|
|