whitening {fastmatrix}R Documentation

Whitening transformation

Description

Applies the whitening transformation to a data matrix based on the Cholesky decomposition of the empirical covariance matrix.

Usage

whitening(x, Scatter = NULL)

Arguments

x

vector or matrix of data with, say, pp columns.

Scatter

covariance (or scatter) matrix (p×pp \times p) of the distribution, must be positive definite. If NULL, the covariance matrix is estimated from the data.

Value

Returns the whitened data matrix Z=XWT\bold{Z} = \bold{X W}^T, where

WTW=S1,\bold{W}^T\bold{W} = \bold{S}^{-1},

with S\bold{S} the empirical covariance matrix.

References

Kessy, A., Lewin, A., Strimmer, K. (2018). Optimal whitening and decorrelation. The American Statistician 72, 309-314.

Examples

x <- iris[,1:4]
species <- iris[,5]
pairs(x, col = species) # plot of Iris

# whitened data
z <- whitening(x)
pairs(z, col = species) # plot of

[Package fastmatrix version 0.5-772 Index]