Learn R Programming

metRology (version 0.9-28-1)

algA: 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 NA values should be removed before the computation proceeds.

tol

Convergence tolerance Iteration continues until the relative change in estimated sd drops below tol.

maxiter

Maximum number of iterations permitted.

verbose

Controls information displayed during iteration; see Details.

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.

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.

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

algS, hubers, huberM

Examples

Run this code
# NOT RUN {
#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
	
# }

Run the code above in your browser using DataLab