KPG1_HSTFx

Finds values corresponding to specified fractions of an histogram

Description:

This routine finds the values at defined fractions of an histogram. Thus to find the lower-quartile value, the fraction would be 0.25. Since an histogram technique is used rather than sorting the whole array, the result may not be exactly correct. An histogram with a large number of bins, and the use of linear interpolation between bins in the routine reduce the error.

Invocation

CALL KPG1_HSTFx( NUMBIN, HISTOG, MAXMUM, MINMUM, NFRAC, FRAC, VALUES, STATUS )

Arguments

NUMBIN = INTEGER (Given)
The number of histogram bins. The larger the number of bins the greater the accuracy of the results. 1000 to 10000 is recommended.
HISTOG( NUMBIN ) = INTEGER (Given)
The histogram.
MAXMUM = ? (Given)
The maximum value used to evaluate the histogram.
MINMUM = ? (Given)
The minimum value used to evaluate the histogram.
NFRAC = INTEGER (Given)
Number of fractional positions.
FRAC( NFRAC ) = REAL (Given and Returned)
Fractional positions in the histogram in the range 0.0–1.0. On exit they are arranged into ascending order.
VALUES( NFRAC ) = ? (Returned)
Values corresponding to the ordered fractional positions in the histogram.
STATUS = INTEGER (Given & Returned)
Global status value.

Notes: