\Header{cov.wt}{Weighted Covariance Matrices}
\keyword{multivariate}{cov.wt}
\begin{Usage}
\begin{verbatim}
cov.wt(x, wt = rep(1/nrow(x), nrow(x)), cor = FALSE, center = TRUE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x}] a matrix or data frame.  As usual, rows are observations and
columns are variables.
\item[\texttt{wt}] a non-negative and non-zero vector of weights for each
observation.  Its length must equal the number of rows of \texttt{x}.
\item[\texttt{cor}] A logical indicating whether the estimated correlation
weighted matrix will be returned as well.
\item[\texttt{center}] Either a logical or a numeric vector specifying the
centers to be used when computing covariances.  If \texttt{TRUE}, the
(weighted) mean of each variable is used, if \texttt{FALSE}, zero is
used.  If \texttt{center} is numeric, its length must equal the number
of columns of \texttt{x}.
\end{ldescription}
\end{Arguments}
\begin{Description}
Returns a list containing estimates of the weighted covariance matrix
and the mean of the data, and optionally of the (weighted) correlation
matrix.\end{Description}
\begin{Value}
A list containing the following named components:
\begin{ldescription}
\item[\texttt{cov}] the estimated (weighted) covariance matrix
\item[\texttt{center}] an estimate for the center (mean) of the data.
\item[\texttt{n.obs}] the number of observations (rows) in \texttt{x}.
\item[\texttt{wt}] the weights used in the estimation.  Only returned if given
as an argument.
\item[\texttt{cor}] the estimated correlation matrix.  Only returned if
\texttt{cor} is \texttt{TRUE}.
\end{ldescription}
\end{Value}
\begin{SeeAlso}
\texttt{\Link{cov}}\end{SeeAlso}

