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

Home » Public Forums » archive » Re: randomn problem
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: randomn problem [message #52951 is a reply to message #52949] Mon, 12 March 2007 02:07 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
The problem does not lie with randomn, but with
stddev. If you compute it using double precision
instead, the problem should solve itsef. Example:

a=fltarr(3e7)
a[0:3e7/2]=1.

print,stddev(a)
0.528791
print,stddev(a,/double)
0.50000000

Ciao,
Paolo

askemer@gmail.com wrote:
> Hi all,
>
> I was playing around with randomn and noticed some weird behavior:
>
> IDL> print, stddev(randomn(seed, 1e7))
>
> I consistently get back numbers around ~0.992. I've tried it on a
> different computer, and the result was not exactly the same, but
> similar. If I change 1e7 to 1e8, the problem gets worse, and I get
> ~0.853. I've tried the syntax with floats, integers, and longs, and I
> still get the same answer. Does anyone know what could be going on?
>
> -Andy
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: New IDLDE
Next Topic: Delete bad data and interplate the new data

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

Current Time: Fri Oct 10 09:59:47 PDT 2025

Total time taken to generate the page: 0.56209 seconds