algA {metRology} | R Documentation |
Robust estimation of location and scale using Algorithm A
Description
Algorithm A is an implementation of Huber's location and scale estimate with iterated scale.
Usage
algA(x, k = 1.5, na.rm = FALSE, tol = .Machine$double.eps^0.25,
maxiter = 25, verbose = FALSE)
Arguments
x |
numeric vector or array of values. |
k |
Tuning factor; Winsorisation occurs ar k standard deviations. |
na.rm |
a logical value indicating whether |
tol |
Convergence tolerance Iteration continues until the relative
change in estimated sd drops below |
maxiter |
Maximum number of iterations permitted. |
verbose |
Controls information displayed during iteration; see Details. |
Details
Algorithm A is the robust estimate of location described in ISO 5725-5:1998. It proceeds by winsorisation and re-estimation of scale and location.
The argument k
controls the point at which values are Winsorised
and hence controls the efficiency. At k=1.5
, the value chosen by
ISO 5725, the estimator has asymptotic efficiency at the Normal of 0.964.
With iterated estimate of scale and k=1.5
, the estimator has a
breakdown point of about 30
The convergence criterion for Algorithm A is not specified in ISO 5725-5:1998.
The criterion chosen here is reasonably stringent but the results will differ
from those obtained using other choices. Use verbose=2
to check the
effect of different tolerance or maximum iteration count.
If verbose
is non-zero, the current iteration number
and estimate are printed; if verbose>1
, the current set
of truncated values w
is also printed.
Value
mu |
Robust estimate of location |
s |
Robust estimate of scale |
Warning
Algorithm A uses the corrected median absolute deviation as the initial
estimate of scale; an error is returned if the resulting scale estimate is
zero, which can occur with over 50% of the data set equal. huberM
in
the robustbase package uses an alternative scale estimate in these
circumstances.
Note
Algorithm A is identical to Huber's estimate with variable scale.
The implementation here differs from hubers
from MASS in:
hubers allows prior specification of fixed scale (which provides higher breakdown if chosen properly) or location
the option of verbose output in
algA
,a maximum iteration option in
algA
the convergence criterion; hubers converges on changes in
mu
, whilst this implementation of Algorithm A converges on changes ins
.Internally, Algorithm A multiplies by a correction factor for standard deviation whilst
hubers
divides by a correction factor applied to the variance; the actual correction tos
is identical.
The principal reasons for providing an implementation in the metRology package are i) to ensure a close implementation of the cited Standard irrespective of other package developments (though the MASS implementation has proved very stable) and ii) to make the implementation easy to recognise for users of the ISO standard.
Author(s)
S L R Ellison s.ellison@lgc.co.uk
References
ISO 5725-5:1998 Accuracy (trueness and precision) of measurement methods and results - Part 5: Alternative methods for the determination of the precision of a standard measurement method
Maronna R A, Martin R D, Yohai V J (2006) Robust statistics - theory and methods. Jhn Wiley and Sons, West Sussex, England.
See Also
Examples
#Creosote example from ISO 5725-5:1998
#Means for each group are:
cm <-c(24.140, 20.155, 19.500, 20.300, 20.705, 17.570, 20.100, 20.940, 21.185)
algA(cm, verbose=TRUE)
#Iteration 4 corresponds very closely to the ISO 5725 answer