comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Random number generation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Random number generation [message #92665 is a reply to message #92664] Wed, 03 February 2016 09:48 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le mercredi 3 février 2016 17:51:13 UTC+1, dave poreh a écrit :
> Folks,
> Hi,
> I am working on some simulation problems, that I need to generate random numbers. When I use>
> print, mean(randomu(seed, 100000))
> 0.498516
> print, mean(randomn(seed, 100000))
> 0.00100909
> 1-the randomn is much better than randomu. why is that?
> 2-I am expecting very small number for mean of this random numbers, but as you see they are quite big (i am expecting in order of 10e-7).
> Is there any other way that i can use?
> Thanks for anykind of helps...
> Cheers,
> Dave

randomu generates a random N-vector, uniform in [0,1] with mean=0.5 and std(mean)= sqrt(1/12)/sqrt(N) about 0.001 in your case.
randomn generates a random gaussian N-vector with mean=0 and sigma=1; then std(mean) is 1/sqrt(N) about 0.003 in your case.
Everything is o.k.
alx.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDLWAVE Maintainer Wanted
Next Topic: exelisvis.com is now harrisgeospatial.com

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:39:36 PDT 2025

Total time taken to generate the page: 0.00392 seconds