Learn R Programming

decorrelate (version 0.1.6.3)

getWhiteningMatrix: Get whitening matrix

Description

Get whitening matrix implied by eclairs decompostion

Usage

getWhiteningMatrix(ecl, lambda)

Value

whitening matrix

Arguments

ecl

estimate of covariance/correlation matrix from eclairs storing \(U\), \(d_1^2\), \(\lambda\) and \(\nu\)

lambda

specify lambda and override value from ecl

Examples

Run this code
library(Rfast)

n <- 2000
p <- 3

Y <- matrnorm(n, p, seed = 1) * 10

# decorrelate with implicit whitening matrix
# give same result as explicity whitening matrix
ecl <- eclairs(Y, compute = "covariance")

# get explicit whitening matrix
W <- getWhiteningMatrix(ecl)

# apply explicit whitening matrix
Z1 <- tcrossprod(Y, W)

# use implicit whitening matrix
Z2 <- decorrelate(Y, ecl)

range(Z1 - Z2)

Run the code above in your browser using DataLab