whiten: Whiten data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/whiten.R

Description

Whiten data and return the results as an object of class coords.

Usage

1
  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. x in the new basis).

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 compute.scores==TRUE, this is x expressed in the new basis

Author(s)

Jochen Voss <voss@seehuhn.de>

See Also

coords

Examples

1
2
3
  w <- whiten(iris[, 1:4])
  colMeans(w$y)
  round(cov(w$y), 3)

seehuhn/jvcoords documentation built on June 9, 2021, 3:06 p.m.