Inverting Large Matrices (Overflow error)

Hi all,

I’m trying to invert a large matrix (1001 by 1001) to perform Ridge Regression in Julia. I’m running into this “Stack overflow Error:”, I’ve recreated the problem with simpler code (not my Ridge Regression code, which is much messier) to illustrate what I’m dealing with. I’m using Julia in a Jupyter Notebook if that is of any concern. Could someone help me invert a large matrix or solve Ax=b for large A? Thank you!

(in this example I show that even a 100 by 100 matrix triggers this response, but 50 by 50 works)

This is a known problem with Julia 1.7.0 and 1.6.4. 1.6.3 is unaffected, and 1.7.1 and 1.6.5 will fix this.


Oh ok, thank you for your fast response. I apologize for bringing up the old issue, I couldn’t find it on google. I’ll update my software then.

in version 1.6.4, you can also use:

using LinearAlgebra
x = 1001
pinv(rand(Uniform(-1, 1), x, x))

on my installation, it does not appear to suffer the same issue. Provided that pinv() is adequate in your regression context.

On my Intel processor running Julia 1.7.0,

using MKL

eliminates the problem, which is restricted to OpenBLAS.