affine.trans: Function For Affine Data Transformation

Description Usage Arguments Value Author(s) Examples

View source: R/affinetrans.R

Description

Function for transformations of the form Ax+b or A^(1/2)x+b.

Usage

1
2
affine.trans(X, A = diag(1, dim(X)[2]), b = rep(0, dim(X)[2]), 
             A.sqrt = FALSE, na.action = na.fail)

Arguments

X

a numeric data frame or matrix with p columns.

A

full rank p times p matrix.

b

numeric vector of length p.

A.sqrt

logical. If TRUE the symmetric square root of A will be used.

na.action

a function which indicates what should happen when the data contain 'NA's. Default is to fail.

Value

a matrix.

Author(s)

Klaus Nordhausen

Examples

1
2
3
4
5
6
7
data(iris)
IRIS <- iris[,1:4]
colMeans(IRIS)
cov(IRIS)
IRIS.trans <- affine.trans(IRIS, solve(cov(IRIS)), colMeans(IRIS),TRUE)
colMeans(IRIS.trans)
cov(IRIS.trans)

MNM documentation built on May 2, 2019, 5:09 a.m.