STATISTICS

From ICE Enterprises
Jump to navigation Jump to search

determines statistics of data file

<IN>    Input file name
<MEAN>  Results label for mean.  If complex <MEAN>.r and <MEAN>.i.
<SDEV>  Results label for standard deviation
<ELEM>  Results label for number of elements
<IMEAN> DEPRECATED: use <MEAN>.i
<MAX>   Results label for maximum value
<MIN>   Results label for minimum value
<AMIN>  Results label for abscissa of minimum
<AMAX>  Results label for abscissa of maximum
<OMIN>  Results label for offset of minimum
<OMAX>  Results label for offset of maximum

Keyword Only Parameters:
  [SUM]    Sum of all values in file
  [TABLE]  Results label for a table to put all of the results into. The keys
           of the table will match the tag names given above (i.e. MIN,MAX,
           OMIN,OMAX,etc). (Added in NeXtMidas 2.1.0)

Legacy Keyword Only Parameters:                          (since NeXtMidas 3.3.0)
  The following keyword-only parameters match FSTATISTICS in X-Midas and are
  provided in a deprecated form to aid when porting macros from X-Midas to
  NeXtMidas. (Note that they must be used in TAG=val form.)

    [STDV]  - same as <SDEV>
    [MAXV]  - same as <MAX>                               
    [MINV]  - same as <MIN>                                
    [MAXI]  - same as <OMAX> [WARNING: zero-based in NeXtMidas]
    [MINI]  - same as <OMIN> [WARNING: zero-based in NeXtMidas]
    [MAXA]  - same as <AMAX>
    [MINA]  - same as <AMIN>
    [ISUM]  - deprecated, use [SUM].i

Determines for any type 1000 or 2000 data file the number of elements in the
file and their mean and standard deviation.  These file attributes are output
to the terminal.  In addition, the quantities computed by the STATISTICS command
can be entered in the results table.  Results table entries are made only for
those quantities whose labels are supplied by the user, i.e. if any label is
not present the corresponding quantity is NOT written into the results file.

For complex format data, <MEAN>.r and <MEAN>.i are available and the standard
deviation is computed in terms of the magnitude.

(DEPRECATED: use <MEAN>.i) For real and integer format files, <IMEAN> is not
applicable.  For complex format data, <IMEAN> is also available and the standard
deviation is computed in terms of the magnitude.

Double precision is used when computing the statistics. Note that X-Midas uses
a lower precision by default (view the X-Midas explain file for details), this
often causes X-Midas to pick the less accurate MIN and MAX points (especially
when using complex numbers).

The results of computing the statics of a file with zero elements is undefined,
except for the number of elements (ELEM) which will be zero. Also, if the MAX
or MIN value occurs more than once the offsets will be computed for the first
occurrence.

If the /PIECEWISE switch is specified, the results are output and reset for
each transfer lengths worth of data.

Examples:
  * View the statistics of a file.
    nM> STATISTICS sinewave

  * Put the MIN and MAX values into results named MYMIN and MYMAX.
    nM> STATISTICS sinewave MIN=MYMIN MAX=MYMAX

  * Print just the MIN and MAX values to the terminal
    nM> STATISTICS sinewave MIN=TERMINAL MAX=TERMINAL

  * Put the the statistics for a file into a table.
    nM> STATISTICS sinewave TABLE=MYTABLE

  * Show the statistics of each transfer length in a pipe
    startmacro
      ...
      pipe on
        ...
        statistics/tl=4k _temp table=statisticsTab /piecewise
        ...
      pipe off
      ...
    endmacro

Switches:
  /ONEBASE - Output OMIN and OMAX using 1-based indexing (like X-Midas).
             (Added in NeXtMidas 2.1.0)
  /PIECEWISE - If present, the results are output and reset for each transfer 
               length worth of data.
  /TL=     - Transfer Length in logical elements 
  /VERBOSE - If ANY output results label are given, output to the screen is
             suppressed unless this switch is given.