equilibrate: Column equilibration of a rectangular matrix

Description Usage Arguments Value Examples

View source: R/equilibrate.R

Description

Equilibrate the columns of a rectangular matrix using 2-norm.

Usage

1

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

1
2
3
4
5
6
7
8
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

fastmatrix documentation built on Oct. 18, 2021, 5:08 p.m.