# DUEMBGENshape: Duembgen's Shape Matrix In fastM: Fast Computation of Multivariate M-Estimators

## Description

Iterative algorithm to estimate Duembgen's shape matrix using a partial Newton-Raphson approach.

## Usage

 `1` ```DUEMBGENshape(X, nmax = 500, eps = 1e-06, maxiter = 100, perm = FALSE) ```

## Arguments

 `X` numeric data matrix or dataframe. Missing values are not allowed. `nmax` integer, if the sample size n (number of rows of `X`) is smaller than `nmax`, then all n(n-1)/2 pairwise differences will be computed and used in the algorithm. If n is larger, then the algorithm avoids storing all the pairwise differences and is more memory efficient. `eps` convergence tolerance, which means that the algorithm stops when the Frobenius norm of the gradient is smaller than eps. `maxiter` maximum number of iterations. `perm` logical. If TRUE the rows of `X` will be randomly permuted before starting the computations. See details.

## Details

The estimate is based on the new fast algorithm described in Duembgen et al. (2016). Note that Duembgen's shape matrix is standardized such that it has determinant 1.

The function does not check if there are several identical observations. In that case the function will fail.

To get a good initial value for the algorithm, the estimator is first computed based on the pairwise differences of successive observations. Therefore the order of the rows of `X` is supposed to be random. If this is not the case, the data should be first permuted using the argument `perm`.

In case `maxiter` is reached before convergence, the estimate at that iteration is returned and a warning is given.

## Value

A list containing:

 `Sigma` Estimated shape matrix. `iter` Number of iterations of the algorithm.

## Author(s)

Lutz Duembgen and Klaus Nordhausen

## References

Duembgen, L. (1998), On Tyler's M-functional of scatter in high dimension, Annals of Institute of Statistical Mathematics, 50, 471–491.

Duembgen, L., Nordhausen, K. and Schuhmacher, H. (2016), New algorithms for M-estimation of multivariate location and scatter, Journal of Multivariate Analysis, 144, 200–217. doi: 10.1016/j.jmva.2015.11.009

`tyler.shape`

## Examples

 ```1 2 3 4 5``` ```DUEMBGENshape(longley) DUEMBGENshape(longley, nmax=10) # compare to # library(ICSNP) # duembgen.shape(longley) ```

### Example output

```\$Sigma
GNP.deflator       GNP Unemployed Armed.Forces Population
GNP.deflator     9.632427  87.01088   49.96269    28.545623   5.947350
GNP             87.010882 798.73276  439.31650   252.870216  54.724575
Unemployed      49.962692 439.31650  707.87227   -97.815603  34.792811
Armed.Forces    28.545623 252.87022  -97.81560   398.037813  14.403952
Population       5.947350  54.72458   34.79281    14.403952   3.816897
Year             4.165543  38.06977   23.39288    11.356145   2.629198
Employed         3.039588  28.06546   12.79177     9.237134   1.894036
Year  Employed
GNP.deflator  4.165543  3.039588
GNP          38.069769 28.065464
Unemployed   23.392881 12.791773
Armed.Forces 11.356145  9.237134
Population    2.629198  1.894036
Year          1.831520  1.325913
Employed      1.325913  1.019916

\$iter
[1] 10

\$Sigma
GNP.deflator       GNP Unemployed Armed.Forces Population
GNP.deflator     9.632427  87.01088   49.96269    28.545623   5.947350
GNP             87.010882 798.73276  439.31650   252.870216  54.724575
Unemployed      49.962692 439.31650  707.87227   -97.815603  34.792811
Armed.Forces    28.545623 252.87022  -97.81560   398.037813  14.403952
Population       5.947350  54.72458   34.79281    14.403952   3.816897
Year             4.165543  38.06977   23.39288    11.356145   2.629198
Employed         3.039588  28.06546   12.79177     9.237134   1.894036
Year  Employed
GNP.deflator  4.165543  3.039588
GNP          38.069769 28.065464
Unemployed   23.392881 12.791773
Armed.Forces 11.356145  9.237134
Population    2.629198  1.894036
Year          1.831520  1.325913
Employed      1.325913  1.019916

\$iter
[1] 10
```

fastM documentation built on May 2, 2019, 4:01 a.m.