Next: CCG_WTM4x - Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers and estimating
Up: Routine Descriptions
Previous: CCG_WTM2x - Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers
CCG_WTM3x
- Forms the weighted median of a list of ordered data values.
Incrementing the contributing pixel buffers and estimating the
variance change
- Description:
- This routine finds a value which can be associated with the half-
weight value. It sums all weights then finds a value for the
half-weight. The comparison with the half-weight value proceeds
in halves of the weights for each data point (half of the first
weight, then the second half of the first weight and the first
half of the second weight etc.) until the half weight is
exceeded. The data values around this half weight position are
then found and a linear interpolation of these values is the
weighted median. The values which contribute to the result are
flagged and passed through the USED array. This routine also
uses the order statistic covariance array (for a population EL
big) to estimate the change in the variance from a optimal
measurement from the given population, returning the adjusted
variance.
- Invocation:
- CALL CCG_WTM3x( CALCMV, EL, ORDDAT, WEIGHT, VAR, COVAR, USED,
RESULT, RESVAR, STATUS )
- Arguments:
-
-
CALCMV = LOGICAL (Given)
-
If .FALSE. then the output variances are estimated by scaling
the variance on the weighted mean (rather than the weighted
median) by pi/2. Otherwise, the output variances are
calculated using the COVEC array.
-
EL = INTEGER (Given)
-
The number of entries in the data array.
-
ARR( EL ) = ? (Given)
-
The list of ordered data for which the weighted median is
required
-
WEIGHT( EL ) = ? (Given)
-
The weights of the values.
-
VAR = DOUBLE PRECISION (Given)
-
The variance of the unordered sample now ordered in ARR.
-
COVAR(
) = DOUBLE PRECISION (Given)
-
The packed variance-covariance matrix of the order statistics
from a normal distribution of size EL. Not used if CALCMV is .FALSE.
-
USED( EL ) = LOGICAL (Returned)
-
If a value contributes to the median value it is flagged as
true in this array, otherwise the array is set to false.
-
RESULT = DOUBLE PRECISION (Returned)
-
The weighted median
-
RESVAR = DOUBLE PRECISION (Returned)
-
The variance of result.
-
NBAD = INTEGER (Returned)
-
The number of bad values in the output array.
-
STATUS = INTEGER (Given and Returned)
-
The global status.
- Notes:
- There is a routine for real and double-precision: replace "x"
in the routine name by D or R as appropriate. The ORDDAT and
WEIGHT arguments supplied to the routine must have the data type
specified.
-
Prior Requirements
- The input data must be ordered increasing. No BAD values may be
present.
Next: CCG_WTM4x - Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers and estimating
Up: Routine Descriptions
Previous: CCG_WTM2x - Forms the weighted median of a list of ordered data values. Incrementing the contributing pixel buffers
KAPLIBS -- Internal subroutines used within the KAPPA package.
Starlink User Note 238
D.S. Berry
Malcolm J. Currie
9th March 2009
E-mail:ussc@star.rl.ac.uk
Copyright © 2010 Science and Technology Facilities Council