BSSprep {BSSprep} | R Documentation |
A function for data whitening.
BSSprep(X)
X |
A numeric matrix. Missing values are not allowed. |
A p-variate Y with T observations is whitened, i.e. Y = S^(-1/2)*(X_t - (1/T)*sum_t(X_t)), for t = 1, …, T, where S is the sample covariance matrix of X.
This is often need as a preprocessing step like in almost all blind source separation (BSS) methods. The function is implemented using C++ and returns the whitened data matrix as well as the ingredients to back transform.
A list containing the following components:
Y |
The whitened data matrix. |
X.C |
The mean-centered data matrix. |
COV.sqrt.i |
The inverse square root of the covariance matrix of X. |
MEAN |
Mean vector of X. |
Markus Matilainen, Klaus Nordhausen
n <- 100 X <- matrix(rnorm(10*n) - 1, nrow = n, ncol = 10) res1 <- BSSprep(X) res1$Y # The whitened matrix colMeans(res1$Y) # should be close to zero cov(res1$Y) # should be close to the identity matrix res1$MEAN # Should hover around -1 for all 10 columns