Weighted by Lp depth (outlyingness) multivariate location and scatter estimators.
CovLP(x, pdim = 2, la = 1, lb = 1)
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 Lpdim depth |
la | parameter of a simple weight function w=ax+b |
lb | parameter of a simple weight function w=ax+b |
loc: Robust Estimate of Location:
cov: Robust Estimate of Covariance:
Returns depth weighted covariance matrix.
Using depth function one can define a depth-weighted location and scatter estimators. In case of location estimator we have L(F)=∫xw1(D(x,F))dF(x)/w1(D(x,F))dF(x)
The DepthProc package offers these estimators for weighted Lp depth. Note that L(⋅) and S(⋅) include multivariate versions of trimmed means and covariance matrices. Their sample counterparts take the form TWD(Xn)=n∑i=1diXi/n∑i=1di,
depthContour
and depthPersp
for depth graphics.
# 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)#> #> Call: #> CovLP(x = data1990) #> -> Method: Depth Weighted Estimator #> #> Robust Estimate of Location: #> [1] 49.7 41.9 83.0 #> #> Robust Estimate of Covariance: #> [,1] [,2] [,3] #> [1,] 3010.1 1771.8 -499.6 #> [2,] 1771.8 1079.8 -295.4 #> [3,] -499.6 -295.4 252.7