Learn R Programming

cpgen (version 0.1)

ccov: ccov

Description

Computation of covariance- or correlation-matrix. Shrinkage estimate through the use of 'lambda'. Weights for observations can be passed.

Usage

ccov(X,lambda=0, w=NULL, compute_cor=FALSE)

Arguments

X
matrix
lambda
numeric scalar, shrinkage parameter
w
numeric vector of weights with same lengths as rows in X
compute_cor
boolean - defines whether the functions returns a correlation- rather than a covariance matrix

Value

Covariance matrix with dimension ncol(X)

Examples

Run this code
## Not run: 
# # generate random data
# rand_data(500,5000)
# 
# # compute correlation matrix of t(M)
# corM <- ccov(t(M),compute_cor=T)
# ## End(Not run)

Run the code above in your browser using DataLab