algS {metRology}R Documentation

‘Algorithm S’ - robust estimate of pooled standard deviation

Description

‘Algorithm S’ calculates a robust estimate of pooled standard deviation from a set of standard deviations

Usage

	algS(s, degfree, na.rm = FALSE, prob.eta = 0.9, 
		is.range = FALSE, tol = .Machine$double.eps^0.25, 
		maxiter = 25, verbose = FALSE)

Arguments

s

A vector of standard deviations or, if is.range is TRUE, ranges.

degfree

Scalar number of degrees of freedom associated with all values in s. If a vector is supplied, median(degfree) will be used.

na.rm

a logical value indicating whether 'NA' values should be stripped before the computation proceeds.

prob.eta

prob.eta is set to specify the lower tail area of the chi-squared distribution used as a cut-off.

is.range

if is.range is TRUE, s is interpreted as a vector of positive differences of duplcate observations and degfree is set to 1

tol

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

maxiter

Maximum number of iterations permitted.

verbose

Controls information displayed during iteration; see Details.

Details

Algorithm S is suggested by ISO 5725-5:1998 as a robust estimator of pooled standard deviation spools_{pool} from standard deviations of groups of size ν+1\nu+1.

The algorithm calculates a ‘limit factor’, η\eta, set to qchisq(prob.eta, degfree). Following an initial estimate of spools_{pool} as median(s), the standard deviations sis_i are replaced with wi=min(ηspool,si)w_i=min(\eta*s_{pool}, s_i) and an updated value for spools_{pool} calculated as

ξi=1p(wi)2p\xi*\sqrt{\frac{\sum_{i=1}^{p} (w_i)^2}{p}}

where pp is the number of standard deviations and ξ\xi is calculated as

ξ=1χp12(νη2+(1pη)η2)\xi=\frac{1}{\sqrt{\chi_{p-1}^{2}\left(\nu\eta^{2}+\left(1-p_{\eta}\right)\eta^{2}\right)}}

If the sis_i are ranges of two values, ISO 5725 recommends carrying out the above iteration on the ranges and then dividing by ν+1\sqrt{\nu+1}; in the implementation here, this is done prior to returning the estimate.

If verbose is non-zero, the current iteration number and estimate are printed; if verbose>1, the current set of truncated values ww is also printed.

Value

A scalar estimate of poooled standard deviation.

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

See Also

algA

Examples

#example from ISO 5725-5:1998 (cell ranges for percent creosote)

cdiff <- c(0.28, 0.49, 0.40, 0.00, 0.35, 1.98, 0.80, 0.32, 0.95)

algS(cdiff, is.range=TRUE)
	

#Compare with the sd of the two values (based on the range)
c.sd <- cdiff/sqrt(2)
algS(c.sd, degfree=1, verbose=TRUE)



[Package metRology version 0.9-28-1 Index]