Kappa condition number in R I have read that the kappa function in R does not always explicitly calculate the condition number of a matrix, but rather, estimates the 2 norm of a matrix or a QR decomposition (see here). I was just wondering if anyone knows what the approximation used here is and has any idea where I can read more about the math of the underlying algorithm behind kappa?
Update: As user yarnabrina has pointed out, the functions in the R source code I am particularly interested in are .kappa_tri and kappa.qr. Thanks again to yarnabrina and also any future answers!
 A: From the documentation of kappa, you can use exact = TRUE, and it'll use SVD for the exact calculation.

For kappa(), if exact = FALSE (the default) the 2-norm condition number is estimated by a cheap approximation. However, the exact calculation (via svd) is also likely to be quick enough.

For details of the method, you can check the source code, available at here. Here's a part from that:
kappa.default <- function(z, exact = FALSE,
                          norm = NULL, method = c("qr", "direct"), ...)
{
    method <- match.arg(method)
    z <- as.matrix(z)
    norm <- if(!is.null(norm)) match.arg(norm, c("2", "1","O", "I")) else "2"
    if(exact && norm == "2") {
        s <- svd(z, nu = 0, nv = 0)$d
        max(s)/min(s[s > 0])
    }
    else { ## exact = FALSE or norm in "1", "O", "I"
    if(exact)
        warning(gettextf("norm '%s' currently always uses exact = FALSE",
                 norm))
        d <- dim(z)
        if(method == "qr" || d[1L] != d[2L])
        kappa.qr(qr(if(d[1L] < d[2L]) t(z) else z),
             exact = FALSE, norm = norm, ...)
        else .kappa_tri(z, exact = FALSE, norm = norm, ...)
    }
}

