rdepthmedian | R Documentation |
Computes the deepest regression, i.e. the hyperplane with maximal
regression depth given a regression dataset with p
explanatory variables. The computation is exact for simple regression, and approximate otherwise.
rdepthmedian(x, maxit = NULL)
x |
An |
maxit |
The maximum number of iterations. |
In simple regression the deepest regression fit can be computed exactly by considering all lines through two data points and taking the one with maximal regression depth. If several lines have the same maximal regression depth, their average is taken.
When p > 1
, the approximate MEDSWEEP algorithm is applied (Van Aelst et al, 2002).
It is first checked whether the data lie in a subspace of
dimension smaller than p + 1
. If so, a warning is given, as well as the dimension of the subspace and a direction which is orthogonal to it.
A list with components:
deepest |
A |
depth |
The depth of the deepest regression hyperplane. |
niter |
The number of performed iterations used in the medsweep algorithm. |
dimension |
When the data |
hyperplane |
When the data |
P. Segaert using Fortran code by S. Van Aelst
Van Aelst S., Rousseeuw P.J., Hubert M., Struyf A. (2002). The deepest regression method. Journal of Multivariate Analysis, 81, 138–166.
rdepth
, cmltest
# Illustrate the concept of deepest regression line in the case of simple
# linear regression.
data(stars)
plot(stars, pch=16)
result <- rdepthmedian(x = stars)
abline(result$deepest, col="blue", lwd=2)
x <- matrix(rnorm(3000), ncol = 3) + 10
rdepthmedian(x = x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.