Learn R Programming

DepthProc (version 2.1.5)

CovLP: CovLp

Description

Weighted by \( L ^ p \) depth (outlyingness) multivariate location and scatter estimators.

Usage

CovLP(x, pdim = 2, la = 1, lb = 1)

Arguments

x

The data as a matrix or data frame. If it is a matrix or data frame, then each row is viewed as one multivariate observation.

pdim

The parameter of the weighted \( {L} ^ {p} dim \) depth

la

parameter of a simple weight function \( w = ax + b \)

lb

parameter of a simple weight function \( w = ax + b \)

Value

loc: Robust Estimate of Location:

cov: Robust Estimate of Covariance:

Returns depth weighted covariance matrix.

Details

Using depth function one can define a depth-weighted location and scatter estimators. In case of location estimator we have $$ L(F) = {\int {{x}{{w}_{1}}(D({x}, F))dF({x})}} / {{{w}_{1}}(D({x}, F))dF({x})} $$ Subsequently, a depth-weighted scatter estimator is defined as $$ S(F) = \frac{ \int {({x} - L(F)){{({x} - L(F))} ^ {T}}{{w}_{2}}(D({x}, F))dF({x})} }{ \int {{{w}_{2}}(D({x}, F))dF({x})}}, $$ where \( {{w}_{2}}(\cdot) \) is a suitable weight function that can be different from \( {{w}_{1}}(\cdot) \).

The DepthProc package offers these estimators for weighted \( {L} ^ {p} \) depth. Note that \( L(\cdot) \) and \( S(\cdot) \) include multivariate versions of trimmed means and covariance matrices. Their sample counterparts take the form $$ {{T}_{WD}}({{{X}} ^ {n}}) = {\sum\limits_{i = 1} ^ {n} {{{d}_{i}}{{X}_{i}}}} / {\sum\limits_{i = 1} ^ {n} {{{d}_{i}}}}, $$ $$ DIS({{{X}}^{n}}) = \frac{ \sum\limits_{i = 1} ^ {n} {{{d}_{i}}\left( {{{X}}_{i}} - {{T}_{WD}}({{{X}} ^ {n}}) \right){{\left( {{{X}}_{i}} - {{T}_{WD}}({{{X}} ^ {n}}) \right)} ^ {T}}} }{ \sum\limits_{i = 1} ^ {n} {{{d}_{i}}}}, $$ where \( {{d}_{i}} \) are sample depth weights, \( {{w}_{1}}(x) = {{w}_{2}}(x) = x \).

See Also

depthContour and depthPersp for depth graphics.

Examples

Run this code
# NOT RUN {
# EXAMPLE 1
x <- mvrnorm(n = 100, mu = c(0, 0), Sigma = 3 * diag(2))
cov_x <- CovLP(x, 2, 1, 1)

# EXAMPLE 2
data(under5.mort, inf.mort, maesles.imm)
data1990 <- na.omit(cbind(under5.mort[, 1], inf.mort[, 1], maesles.imm[, 1]))
CovLP(data1990)

# }

Run the code above in your browser using DataLab