Learn R Programming

fastmatrix (version 0.3-8)

equilibrate: Column equilibration of a rectangular matrix

Description

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

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

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab