Description Usage Arguments Value Note Author(s) Source References See Also Examples
The Rosner (1975) method or the essence of the method, given the order statistics x_{[1:n]} ≤ x_{[2:n]} ≤ \cdots ≤ x_{[(n-1):n]} ≤ x_{[n:n]}, is the statistic:
RS_r = \frac{ x_{[r:n]} - \mathrm{mean}\{x_{[(r+1)\rightarrow(n-r):n]}\} } {√{\mathrm{var}\{x_{[(r+1)\rightarrow(n-r):n]}\}}}\mbox{,}
1 |
x |
The data values and note that base-10 logarithms of these are not computed internally; |
r |
The number of truncated observations; and |
n |
The number of observations. |
The value for RS_r.
Regarding n=length(x)
, it is not clear that TAC intended n
to be not equal to the sample size. TAC chose to not determine the length of x
internally to the function but to have it available as an argument. Also MGBTcohn2011
and BLlo
were similarly designed.
W.H. Asquith consulting T.A. Cohn sources
LowOutliers_jfe(R).txt
and LowOutliers_wha(R).txt
—Named RST
Cohn, T.A., 2013–2016, Personal communication of original R source code: U.S. Geological Survey, Reston, Va.
Rosner, Bernard, 1975, On the detection of many outliers: Technometrics, v. 17, no. 2, pp. 221–227.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Long CPU time, arguments slightly modified to run faster and TAC had.
# TAC has maxr=n/2 (the lower tail) but WHA has changed to maxr=3 for
# speed to get the function usable during automated tests.
testMGBvsN3 <- function(n=100, maxr=3, nrep=10000) { # TAC named function
for(r in 1:maxr) {
set.seed(123457)
res1 <- replicate(nrep, { x <- sort(rnorm(n))
c(MGBTcohn2011(x,r),BLlo(x,r),RSlo(x,r)) })
r1 <- rank(res1[1,]); r2 <- rank(res1[2,]); r3 <- rank(res1[3,])
v <- quantile(r1,.1); h <- quantile(r2,.1)
plot(r1,r2)
abline(v=v, col=2); abline(h=h, col=2)
message(' BLlo ',r, " ", cor(r1,r2), " ", mean((r1 <= v) & (r2 <= h)))
v <- quantile(r1,.1); h <- quantile(r2,.1)
plot(r1,r3)
abline(v=v, col=2); abline(h=h, col=2)
mtext(paste0("Order statistic iteration =",r," of ",maxr))
message('RSTlo ',r, " ", cor(r1,r3), " ", mean((r1 <= v) & (r3 <= h)))
}
}
testMGBvsN3() #
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.