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

Home » Public Forums » archive » Re: statistics on large arrays
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: statistics on large arrays [message #14680] Wed, 24 March 1999 00:00
korpela is currently offline  korpela
Messages: 59
Registered: September 1993
Member
In article <dcDJ2.929$Rd5.1323@news.flash.net>,
Steve Carothers <onav1@flash.net> wrote:
> Is there a limit to how large an array can be when finding the average or
> stdev of the entire array? I have an array of about 630,000 elements. When
> I try to find the average, the result is "NaNQ".

Are all of the values in the array defined values (i.e. not Inf or NaN)?
An Inf or a NaN in an array will cause the average to be NaN.

Eric

--
Eric Korpela | An object at rest can never be
korpela@ssl.berkeley.edu | stopped.
<a href="http://sag-www.ssl.berkeley.edu/~korpela">Click for home page.</a>
Re: statistics on large arrays [message #14685 is a reply to message #14680] Tue, 23 March 1999 00:00 Go to previous message
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Steve Carothers wrote:
>
> Is there a limit to how large an array can be when finding the average or
> stdev of the entire array? I have an array of about 630,000 elements. When
> I try to find the average, the result is "NaNQ".
>
> Steve

One thing you may want to try is to explicitely use a double formatted
array to overcome this problem (although you may then approach your
memory limits ...). Apparently, MEAN has a /DOUBLE keyword. Does it
help?


IDL> a=findgen(20)
IDL> print,mean(a) & help,mean(a)
% Compiled module: MEAN.
9.50000
<Expression> FLOAT = 9.50000
IDL> a=dindgen(20)
IDL> print,mean(a) & help,mean(a)
9.5000000
<Expression> DOUBLE = 9.5000000


Regards,
Martin.
--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Engineering&Applied Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: DROPLIST problem in CW_FORM
Next Topic: device,cursor_image ??

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

Current Time: Wed Oct 08 11:34:44 PDT 2025

Total time taken to generate the page: 0.00585 seconds