Compute h(alpha) which is the size of the subsamples to be used
for MCD and LTS. Given
\alpha = alpha,
h is an integer,
h \approx \alpha n, where the exact formula also depends on
\alpha = 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).
h.alpha.n(alpha, n, p)
fraction, numeric (vector) in [0.5, 1], see, e.g.,
integer (valued vector), the sample size.
integer (valued vector), the dimension.
numeric vector of
h(\alpha, n,p); when any of the arguments of
length greater than one, the usual R arithmetic (recycling) rules are
ltsReg which are
h = h(\alpha,n,p) and hence both use
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.