Learn R Programming

mrfDepth (version 1.0.2)

rdepthmedian: Hyperplane of maximal regression depth

Description

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.

Usage

rdepthmedian(x, maxit = NULL)

Arguments

x
An $n$ by $p+1$ regression data matrix. The first $p$ columns are the explanatory variables. The last column corresponds to the response variable.
maxit
The maximum number of iterations. Defaults to $100$.

Value

A list with components:

Details

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.

References

Van Aelst S., Rousseeuw P.J., Hubert M., Struyf A. (2002). The deepest regression method. Journal of Multivariate Analysis, 81, 138--166.

See Also

rdepth, cmltest

Examples

Run this code
# Illustrate the concept of deepest regression line in the case of simple 
# linear regression. 
data("stars")
plot(stars)
result <- rdepthmedian(x = stars)
abline(result$deepest)

x <- matrix(rnorm(3000), ncol = 3) + 10
rdepthmedian(x = x)

Run the code above in your browser using DataLab