# Condition number calculation in R

If I understood correctly, the condition number should be a product of Frobenious norms of a matrix and its inverse.

In R if I do the following:

m = matrix(0, nrow=3, ncol=3)
m[col(m) == row(m)] = c(5,3,1)
minv = solve(m)

norm(m, type='F') * norm(minv, type='F')

kappa(m, exact=TRUE, norm='2' )


I get different numbers, can somebody please explain to me why this is so?

• Although asked in the context of R, the nature of the condition number is a statistical question. This should be on topic here. – gung - Reinstate Monica Oct 19 '16 at 14:05
• Dear gung, Would you be so kind to transfer to the appropriate stack, or answer the question. Best regards. – user680111 Oct 19 '16 at 14:09
• Someone voted to close. I'm saying it needn't be closed. – gung - Reinstate Monica Oct 19 '16 at 14:10

Compare:

norm(m, type='F')

With:

norm(m, type='2')

At first I thought (as you probably did) that with the 2-norm they meant the 2-norm when considering the matrix as a vector. However I found it odd that they used 2 notations in different places ('F' for Frobenius and '2' for 2-norm). Then I saw that the norm function has both as options (see: ?norm). That led me through some googling to the following wikipedia page:
https://en.wikipedia.org/wiki/Matrix_norm#Induced_norm
Here they explain the 2-norm they use on matrices in R.

TL;DR: Frobenius norm isn't the 2-norm on matrices.