duembgen.shape.wt: Weighted Duembgen's Shape Matrix

View source: R/duembgen.shape.wt.R

duembgen.shape.wtR Documentation

Weighted Duembgen's Shape Matrix

Description

Iterative algorithm to estimate the weighted version of Duembgen's shape matrix.

Usage

duembgen.shape.wt(X, wt = rep(1, nrow(X)), init = NULL, 
                  eps = 1e-06, maxiter = 100, na.action = na.fail)

Arguments

X

numeric data frame or matrix.

wt

vector of weights. Should be nonnegative and at least one larger than zero.

init

an optional matrix giving the starting value for the iteration.

eps

convergence tolerance.

maxiter

maximum number of iterations.

na.action

a function which indicates what should happen when the data contain 'NA's. Default is to fail.

Details

The weighted Duembgen shape matrix can be seen as tyler.shape's matrix wrt to the origin for the weighted pairwise differences of the observations. Therefore this shape matrix needs no location parameter.

Note that this function is memory comsuming and slow for large data sets since the matrix is based on all pairwise difference of the observations.

Value

a matrix.

Author(s)

Klaus Nordhausen

References

Sirkia, S., Taskinen, S. and Oja, H. (2007), Symmetrised M-estimators of scatter. Journal of Multivariate Analysis, 98, 1611–1629.

See Also

duembgen.shape

Examples

set.seed(1)
cov.matrix.1 <- matrix(c(3,2,1,2,4,-0.5,1,-0.5,2), ncol = 3)
X.1 <- rmvnorm(100, c(0,0,0), cov.matrix.1)
cov.matrix.2 <- diag(1,3)
X.2 <- rmvnorm(50, c(1,1,1), cov.matrix.2)
X <- rbind(X.1, X.2)

D1 <-  duembgen.shape.wt(X, rep(c(0,1), c(100,50)))
D2 <-  duembgen.shape.wt(X, rep(c(1,0), c(100,50)))

D1
D2

rm(.Random.seed)

ICSNP documentation built on Sept. 18, 2023, 5:16 p.m.