haskell-numerics / hmatrix

Linear algebra and numerical computation
381 stars 104 forks source link

fix tests #308

Open idontgetoutmuch opened 5 years ago

idontgetoutmuch commented 5 years ago

We still get random failures despite commenting out the more susceptible tests. I think this is easy to fix: we just check we are using sensible matrices in the tests (ones that are not too close to being singular).

See also #259 #145 #19 (maybe)

dpaetzel commented 4 years ago

Hi! How close do you mean by “not too close to being singular”? I ran into issues with singular matrices in hmatrix that I can't quite tie to the algorithm I'm using—could this be due to numeric instabilities? Is there some threshold I could use to debug whether this is the problem I'm seeing?

idontgetoutmuch commented 4 years ago

You can use https://hackage.haskell.org/package/hmatrix-0.20.0.0/docs/Numeric-LinearAlgebra.html#g:18 rcond to find the reciprocal of condition number: https://en.wikipedia.org/wiki/Condition_number. My idea is to test only matrices for which this is smaller than machine precision.

dpaetzel commented 4 years ago

Sounds sensible, I’ll give it a try. Thank you! :slightly_smiling_face: