Description Usage Arguments Value Author(s) Examples
This function takes in a single dataset X with $$X^2$$ and outputs blah
1 | my_Whiten(x)
|
x |
A real-valued matrix with observations.. and variables ... |
v |
The whitening matrix |
z |
The dataset in vars and observations, whitened |
Hans-Peter Bakker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x)
{
x_centered <- apply(x, 2, function(x) {
x - mean(x)
})
cvx <- cov(x_centered)
eigens <- eigen(cvx)
E <- eigens$vectors
D_invsqrt <- diag(1/sqrt(eigens$values))
myBasicWhiteningMatrix <- E %*% D_invsqrt %*% t(E)
z <- myBasicWhiteningMatrix %*% t(x_centered)
list(v = myBasicWhiteningMatrix, z = z)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.