Description Usage Arguments Value References Note See Also Examples
View source: R/OutlierStatistic.R
Robust nonparametric outlier statistic for univariate or multivariate data.
1 | OutlierStatistic( x, nproj=1000, prior=NULL, seed=NULL)
|
x |
A numeric vector or matrix for which the outlier statistic is to be determined. |
nproj |
If |
prior |
If |
seed |
An optional integer argument to |
A vector giving the maximum value of the outlier statistic for each observation over all projections.
W. A. Stahel, Breakdown of Covariance Estimators, doctoral thesis, Fachgruppe Fur Statistik, Eidgenossische Technische Hochshule (ETH), 1981.
D. L. Donoho, Breakdown Properties of Multivariate Location Estimators, doctoral thesis, Department of Statistics, Harvard University, 1982.
Note that partition probabilities are computed from an exponential distribution fit to the outlier statistic, rather than from the empirical distribution of the outlier statistic.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | stat <- OutlierStatistic(faithful)
q.99 <- quantile(stat,.99)
out <- stat > q.99
plot( faithful[,1], faithful[,2],
main="red : .99 quantile for outlier statistic", cex=.5)
points( faithful[out,1], faithful[out,2],
pch = 4, col = "red", lwd = 1, cex = .5)
require(mvtnorm)
set.seed(0)
Sigma <- crossprod(matrix(rnorm(2*2),2,2))
x <- rmvt( 10000, sigma = Sigma, df = 2)
stat <- OutlierStatistic(x)
q.95 <- quantile(stat,.95)
hist(x, main = "gray : .95 quantile for outlier statistic", col = "black")
abline( v = x[stat > q.95], col = "gray")
hist(x, col = "black", add = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.