Estimate the Condition Number

DESCRIPTION:

Returns a number that is an estimate of the condition number of a matrix.

This function is an S Version 3 generic (see Methods); method functions can be written to handle specific S Version 3 classes of data. Classes that already have methods for this function include lm, bdLm, and upper.

USAGE:

kappa(z) 
kappa.default(z) 
kappa.lm(z)
kappa.upper(z)

REQUIRED ARGUMENTS:

z
a matrix or an object, like a fitted model, that contains information from a decomposition of some matrix.

VALUE:

an estimate of the condition number (large values indicate near-singularity of the matrix).

DETAILS:

The condition number itself is the ratio of the largest to the smallest non-zero singular value of the matrix. Methods for kappa generally use a cheap approximation to this. This may underestimate the condition number, but rarely by more than a factor of 5 or so, which in most applications is within the range of vagueness in applying the condition number anyway.

EXAMPLES:

lmfuel <- lm(Fuel ~ Weight + Disp., data=fuel.frame)
kappa(lmfuel)
# Same value as the above:
kappa(cbind(1, fuel.frame$Weight, fuel.frame$Disp.))