Returns a list containing estimates of the weighted covariance
matrix and the mean of the data, and optionally of the (weighted)
correlation matrix. The
covariance matrix is divided by the sum of the weights,
corresponding to n and the ML-estimator in the case of equal
weights, as opposed to n-1 for cov.wt.
a matrix or data frame. As usual, rows are observations and
columns are variables.
wt
a non-negative and non-zero vector of weights for each
observation. Its length must equal the number of rows of
x.
cor
A logical indicating whether the estimated correlation
weighted matrix will be returned as well.
center
Either a logical or a numeric vector specifying the centers
to be used when computing covariances. If TRUE, the
(weighted) mean of each variable is used, if `FALSE, zero is
used. If center
Value
A list containing the following named components:
covthe estimated (weighted) covariance matrix.
centeran estimate for the center (mean) of the data.
n.obsthe number of observations (rows) in x.
wtthe weights used in the estimation. Only returned if given
as an argument.
corthe estimated correlation matrix. Only returned if `cor' is
`TRUE'.