|
Re: statistics on large arrays [message #14685 is a reply to message #14680] |
Tue, 23 March 1999 00:00  |
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/
------------------------------------------------------------ -------
|
|
|