1

I am currently trying to reconstruct some of the function of R's kappa condition number estimation function, which estimates the condition number of a matrix X by:

  • Working out the QR decomposition of X.
  • Calling to LAPACK's dtrcon or LINPACK's dtrco (depending on what the underlying dependencies on the users system are), and calculating the condition number of R, the upper triangular matrix which should have the same condition number as X (see here).

I have been trying to understand what the LAPACK and LINPACK algorithms do as it may be extremely useful for my own coding.

I have managed to find the algorithm that LINPACK uses, which was described here, but have had no luck finding the origin of LAPACK's algorithm. The comments in R's kappa function suggest that these are using different algorithms (see here) but I am unsure...

Long story short, my question is:

Does anyone know if LAPACK's dtrcon and LINPACK's dtrco are using the same algorithm and if not, what algorithm is LAPACK's dtrcon using?

Thank you in advance!

JDoe2
  • 267
  • 1
  • 12
  • You could take a look at the (well commented) code [here](http://www.netlib.org/lapack/explore-3.1.1-html/dtrcon.f.html) – duckmayr Jun 02 '19 at 20:41
  • Thank you for the quick response! Apologies I should have mentioned I had looked at this already in my original post. The main difficulty in estimating the condition number is estimating the 2 norm of the inverse of the matrix in question. The comment for this in the code reads "Estimate the norm of the inverse of A". How this is achieved is often where algorithms for condition estimation vary and this comment does not provide much light on this step. I have never coded in FORTRAN and cannot understand the code below the comment. – JDoe2 Jun 02 '19 at 22:07
  • In addition, following this, going by the comments in the code, the code seems to mutliply something by `inv(A)` and/or `inv(A')`. I cannot understand why this is done and in what situation going by the comments. – JDoe2 Jun 02 '19 at 22:09

0 Answers0