ccov: ccov

View source: R/ctools.R

ccovR Documentation

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

# generate random data
rand_data(100,500)

# compute correlation matrix of t(M)
corM <- ccov(t(M),compute_cor=TRUE)

cheuerde/cpgen documentation built on July 27, 2023, 11:34 a.m.