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 #53021 is a reply to message #52954] Tue, 13 March 2007 09:25 Go to previous messageGo to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Sun, 11 Mar 2007 16:04:39 -0700, askemer wrote:

> Hmm, that's funny. I've tried it on Linux and on OSX. I wonder if print,
> stddev(randomn(seed, 1e8)) works on your computer too? If so, it could be
> a problem with my memory allocation.
>
> -Andy

Clearly accumulating round-off:

IDL> print, stddev(randomn(seed, 1e8))
0.927200

In fact stddev.pro uses MOMENT, which goes to some trouble to avoid
round-off, as follows:

Resid = X - Mean
; Var = TOTAL(Resid^2, Double = Double) / (nX-1.0);Simple formula

; Numerically-stable "two-pass" formula, which offers less
; round-off error. Page 613, Numerical Recipes in C.
Var = (TOTAL(Resid^2, Double = Double) - $
(TOTAL(Resid, Double = Double)^2)/nX)/(nX-1.0)

Though in this case it doesn't do much to help.

JD
[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: Sun Oct 12 05:08:04 PDT 2025

Total time taken to generate the page: 1.84079 seconds