Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

h.alpha.n

Compute h, the subsample size for MCD and LTS


Description

Compute h(alpha) which is the size of the subsamples to be used for MCD and LTS. Given alpha, n and p, h is an integer, h ~= alpha*n, where the exact formula also depends on p.

For α = 1/2, h == floor(n+p+1)/2; for the general case, it's simply n2 <- (n+p+1) %/% 2; floor(2*n2 - n + 2*(n-n2)*alpha).

Usage

h.alpha.n(alpha, n, p)

Arguments

alpha

fraction, numeric (vector) in [0.5, 1], see, e.g., covMcd.

n

integer (valued vector), the sample size.

p

integer (valued vector), the dimension.

Value

numeric vector of h(α, n,p); when any of the arguments of length greater than one, the usual R arithmetic (recycling) rules are used.

See Also

covMcd and ltsReg which are defined by h = h(α,n,p) and hence both use h.alpha.n.

Examples

n <- c(10:20,50,100)
p <- 5
## show the simple "alpha = 1/2" case:
cbind(n=n, h= h.alpha.n(1/2, n, p), n2p = floor((n+p+1)/2))

## alpha = 3/4 is recommended by some authors :
n <- c(15, 20, 25, 30, 50, 100)
cbind(n=n, h= h.alpha.n(3/4, n, p = 6))

robustbase

Basic Robust Statistics

v0.93-7
GPL (>= 2)
Authors
Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Peter Rousseeuw [ctb] (Qn and Sn), Christophe Croux [ctb] (Qn and Sn), Valentin Todorov [aut] (most robust Cov), Andreas Ruckstuhl [aut] (nlrob, anova, glmrob), Matias Salibian-Barrera [aut] (lmrob orig.), Tobias Verbeke [ctb, fnd] (mc, adjbox), Manuel Koller [aut] (mc, lmrob, psi-func.), Eduardo L. T. Conceicao [aut] (MM-, tau-, CM-, and MTL- nlrob), Maria Anna di Palma [ctb] (initial version of Comedian)
Initial release
2021-01-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.