covW | R Documentation |

Estimates the scatter matrix based on one-step M-estimator using mean and covariance matrix as starting point.

```
covW(X, na.action = na.fail, alpha = 1, cf = 1)
```

`X` |
numeric |

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

`alpha` |
parameter of the one-step M-estimator. By default equals to 1. |

`cf` |
consistency factor of the one-step M-estimator. By default equals to 1. |

It is given for `n \times p`

matrix `X`

by

```
COV_{w}(X)=\frac{1}{n} {cf} \sum_{i=1}^n w(D^2(x_i))
(x_i - \bar{ x})^\top(x_i - \bar{ x}),
```

where `\bar{x}`

is the mean vector, `D^2(x_i)`

is the squared
Mahalanobis distance, `w(d)=d^\alpha`

is a
non-negative and continuous weight function and `{cf}`

is a consistency factor.
Note that the consistency factor, which makes the estimator consistent at the multivariate normal distribution, is in most case unknown and therefore the default is to use simply `cf = 1`

.

If

`w(d)=1`

, we get the covariance matrix`cov()`

(up to the factor`1/(n-1)`

instead of`1/n`

).If

`\alpha=-1`

, we get the`covAxis()`

.If

`\alpha=1`

, we get the`cov4()`

with`{cf} = \frac{1}{p+2}`

.

A matrix containing the one-step M-scatter.

Aurore Archimbaud and Klaus Nordhausen

Archimbaud, A., Drmac, Z., Nordhausen, K., Radojicic, U. and Ruiz-Gazen, A. (2023). SIAM Journal on Mathematics of Data Science (SIMODS), Vol.5(1):97–121. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1137/22M1498759")}.

`cov()`

, `cov4()`

, `covAxis()`

```
data(iris)
X <- iris[,1:4]
# Equivalence with covAxis
covW(X, alpha = -1, cf = ncol(X))
covAxis(X)
# Equivalence with cov4
covW(X, alpha = 1, cf = 1/(ncol(X)+2))
cov4(X)
# covW with alpha = 0.5
covW(X, alpha = 0.5)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.