DATA_STATS(3)



NAME

     data_stats:  Function to generate  statistical quantities of
     data array.


SYNOPSIS

     #include <soi_fun.h>
     int  data_stats  (in, in_out);
     SDS *in;
     SDS_STATS *in_out;


DESCRIPTION

     data_stats() calculates the sample statistics  of  the  data
     set  specified  by  in  and  places the results in in_out, a
     pointer to typedef SDS_STATS.  The SDS_STATS  typedef  is  a
     struct whose members are various first- through fourth-order
     statistics of a data array.

     The following quantities  are  calculated:   mean,  standard
     deviation,  skewness, kurtosis, minimum, maximum, minimum of
     the absolute values, and number of valid values.  The sample
     median  is  estimated from a 16k histogram.  Note that these
     are the sample statistics, not the  unbiased  estimators  of
     the parent population statistics.

     The function returns  a  negative  number  if  an  error  is
     detected:
     -1 for failure to allocate memory
     -2 for an invalid data type or a type not yet implemented


AUTHORS

     Lyle Bacon & Rick Bogart


BUGS

     For long (8-byte) integer data, there may be  some  loss  of
     precision  in  the  extremal  values,  as all statistics are
     reported as doubles.  Note that on many  machines  long  and
     int and unsigned int and unsigned long are identical.

     The check for invalid fixed-point  data  does  not  use  the
     internal  fill  value of the SDS, but only the default value
     (largest negative or unsigned positive number  representable
     within the given length).


HISTORY

     1993-04-26     Lyle Bacon     created for SOI V 0.2

     1993-09-15     Rick Bogart    extensive revisions for SOI  V
     0.7
     1998-10-07      Rick  Bogart   fixes  to  high-order  moment
     calculations for                     SOI Version 4.0