| WeiszfeldCov {Gmedian} | R Documentation |
WeiszfeldCov
Description
Estimation of the Geometric median covariation matrix with Weiszfeld's algorithm. Weights (such as sampling weights) for statistical units are allowed.
Usage
WeiszfeldCov(X, weights=NULL, scores=2, epsilon=1e-08, nitermax = 100)
Arguments
X |
Data matrix, with n (rows) observations in dimension d (columns). |
weights |
When |
scores |
An integer |
epsilon |
Numerical tolerance. By defaut 1e-08. |
nitermax |
Maxium number of iterations of the algorithm. By default set to 100. |
Details
This fast and accurate iterative algorithm can deal with moderate size datasets. For large datasets use preferably GmedianCov, if fast estimations are required.
Weights can be given for statistical units, allowing to deal with data drawn from unequal probability sampling designs (see Lardin-Puech, Cardot and Goga, 2014). The principal components standard deviation is estimed robustly thanks to function scaleTau2 from package robustbase.
Value
median |
Vector of the geometric median |
covmedian |
Median covariation matrix |
vectors |
The |
scores |
Principal component scores corresponding to the |
sdev |
The |
iterm |
Number of iterations needed to estimate the median |
itercov |
Number of iterations needed to estimate the median covariation matrix. |
References
Cardot, H. and Godichon-Baggioni, A. (2017). Fast Estimation of the Median Covariation Matrix with Application to Online Robust Principal Components Analysis. TEST, 26, 461-480.
Lardin-Puech, P., Cardot, H. and Goga, C. (2014). Analysing large datasets of functional data: a survey sampling point of view, Journal de la Soc. Fr. de Statis., 155(4), 70-94.
See Also
See also Weiszfeld and GmedianCov.
Examples
## Simulated data - Brownian paths
n <- 1e3
d <- 20
x <- matrix(rnorm(n*d,sd=1/sqrt(d)), n, d)
x <- t(apply(x,1,cumsum))
## Estimation
median.est <- WeiszfeldCov(x)
par(mfrow=c(1,2))
image(median.est$covmedian) ## median covariation function
plot(c(1:d)/d,median.est$vectors[,1]*sqrt(d),type="l",xlab="Time",
ylab="Eigenvectors",ylim=c(-1.4,1.4))
lines(c(1:d)/d,median.est$vectors[,2]*sqrt(d),lty=2)