Description Usage Arguments Details Value References See Also Examples
Assigns outlier probabilities to the partitions by fitting an exponential distribution to a nonparametric outlier statistic for simulated data or partition centroids.
1 2 |
simData |
Observations from a call to | |||||||||||||||
method |
One of the following options:
The default is to use the | |||||||||||||||
shrink |
Shrinkage parameter for outlier detection data. The offsets from
| |||||||||||||||
nproj |
If the data is multivariate or | |||||||||||||||
seed |
An optional integer argument to |
"logdensity"
is generally prefered over "density"
, because
negative values that are large in magniude
of the logarithm of the density will not be
numerically distinguishable as density values.
A vector of probabilities for each partition, obtained by fitting an exponential distribution to the outlier statistic.
C. Fraley, Estimating Outlier Probabilities for Large Datasets, 2017.
simData
,
OutlierStatistic
,
allProb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | set.seed(0)
lead <- leader(faithful)
nlead <- length(lead[[1]]$partitions)
# repeat multiple times to account for randomness
ntimes <- 100
probs <- matrix( NA, nlead, ntimes)
for (i in 1:ntimes) {
probs[,i] <- partProb( simData(lead[[1]]), method = "distance")
}
# median probability for each partition
partprobs <- apply( probs, 1, median)
quantile(probs)
# plot leaders with outlier probability > .95
plot( faithful[,1], faithful[,2], pch = 16, cex = .5,
main = "red : leaders with outlier probability > .95")
out <- partprobs > .95
l <- lead[[1]]$leaders
points( faithful[l[out],1], faithful[l[out],2], pch = 8, cex = 1, col = "red")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.