Skip to contents

Get whitening matrix implied by eclairs decompostion

Usage

getWhiteningMatrix(ecl, lambda)

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

Value

whitening matrix

Examples

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)
#> [1] -8.881784e-16  1.332268e-15