equilibrate {fastmatrix}R Documentation

Column equilibration of a rectangular matrix

Description

scale is generic function whose default method centers and/or scales the columns of a numeric matrix.

Usage

equilibrate(x, scale = TRUE)

Arguments

x

a numeric matrix.

scale

a logical value, the columns of x must be scaled to norm unity?.

Value

For scale = TRUE, the equilibrated (each column scaled to norm one) matrix. The scalings and an approximation of the reciprocal condition number, are returned as attributes "scales" and "condition".

Examples

x <- matrix(c(1, 1, 1,
              1, 2, 1,
              1, 3, 1,
              1, 1,-1,
              1, 2,-1,
              1, 3,-1), ncol = 3, byrow = TRUE)
x <- equilibrate(x)
apply(x, 2, function(x) sum(x^2)) # all 1

[Package fastmatrix version 0.2-357 Index]