fastMCD: fastMCD Estimate location and scatter using FAST-MCD...

Description Usage Arguments Value Examples

View source: R/fastMCD.R

Description

fastMCD Estimate location and scatter using FAST-MCD algorithm

Usage

1
fastMCD(X, h = 0)

Arguments

X

A 2D matrix to estimate location and scatter from

h

An integer optionally specifying number of observations to use

Value

A list of estimated location (center) and scatter (cov)

Examples

1
2
3
4
5
6
7
set.seed(51234)
S <- matrix(runif(5^2), 5)
S <- t(S) %*% S
X <- MASS::mvrnorm(700, mu = rep(0, 5), Sigma = S) # generate random matrix
outliers <- MASS::mvrnorm(140, mu = rep(5, 5), Sigma = S)
X[seq(1, 700, 5), ] <- outliers # set 20% of observations to be outliers 
res <- fastMCD(X) # estimate location and scatter

frankp-0/fastMCD documentation built on Dec. 20, 2021, 8:51 a.m.