Covariance matrix This function is more limited than R's default cov
function. It can only compute a covariance matrix from a data matrix without any missing value handling by the procedure (in R notation) S0 <- sweep(x, 2, colMeans(x))
, crossprod(S0)/(nrow(S0) - 1) # (covariance matrix result)
cov.Rd
Covariance matrix
This function is more limited than R's default cov
function. It can
only compute a covariance matrix from a data matrix without any missing value
handling by the procedure (in R notation)
S0 <- sweep(x, 2, colMeans(x))
,
crossprod(S0)/(nrow(S0) - 1) # (covariance matrix result)