whiten {jvcoords} | R Documentation |
Whiten data
Description
Whiten data and return the results as an object of class
coords
.
Usage
whiten(x, compute.scores = TRUE)
Arguments
x |
A data matrix, rows are observations, columns are variables. |
compute.scores |
Whether to compute the scores (i.e. |
Details
This function whitens the data by finding an affine transformation such that the transformed data has mean 0 and identity covariance matrix.
If compute.scores
is set to FALSE
, only the
information required for the toCoords()
and
fromCoords()
to work is stored in the returned coords
object; otherwise the scores (transformed data) will be stored in
the $y
field of the coords
object.
Value
An object of class coords
, with the following additional
components added:
loadings |
the loadings, each column is one of the new basis vectors |
y |
if |
Author(s)
Jochen Voss <voss@seehuhn.de>
See Also
Examples
w <- whiten(iris[, 1:4])
colMeans(w$y)
round(cov(w$y), 3)