For some (strange) reasons I got interested in the smallest eigenvalue of some larger Moler matrices.
using MatrixDepot
N = 100;
A = matrixdepot("moler", 100);
D, V = eig(A);
D
## -7.60989e-16 2.25006 ... 159.39 439.012 3934.28
The small first value is not correct. Given that the determinant of A is always 1.0, and assuming that the larger eigenvalues (all except the first) are computed quite accurately, an estimate of the smallest eigenvalue would be
1 / prod(D[2:N])
## 5.600713750075904e-60
I confess Iām not sure how exact that might be ā at least it looks plausible.
How can I use multi-precision arithmetic to compute the eigenvalues of such a matrix with high accuracy. Does the eig()
function respect BigFloat numbers?
Or how can I convert A to type Bigfloat, my attempt all ended in ERRORs.
Does the eig() function respect BigFloat numbers?
No, but I have a generic version in my LinearAlgebra
package that does.
julia> eigvals(Hermitian(big.(A)))
100-element Array{BigFloat,1}:
5.600713750075034165085810228763893486586071580437305200804564971581630599461852e-60
2.250061901390757674844326435860334246692852862242433352735727313299503769592587
2.250247728407830329429897008616706505028053480344333733662598874615179114153438
2.250557850104686744287698216476708147421334753575430707168288163403483399462523
2.250992883304446226119693246851165099984390400083428923194445049530425830741413
2.251553695214128540284873292126553179600708061722409114892456975412502433101787
2.252241407111241374948541997206620374265529867893736044272588337832369708647108
2.253057399129699334219929420618106604897992407838617803516156434953817575465668
2.25400331618029656891737571526405666210323626131091517498318264799251124406059
2.255081075049581166883464571004909861498441236028020708438164489381035606694269
2.256292872730104557075059659066177896488250463085521084681190440487074040600866
2.257641196044752753963916591700358170038269760953492608071886381415099794399297
ā®
9.534543173051246533291982300698306113562038414786506653860716803951035627223942
1.101813340276408413756880604826630300368072844171881772952532155732374129842588e+01
1.299439658160823658138349369301275110841621390165509428843594519674170322199607e+01
1.570838225504344847997737477249262922458682047923149362289039789861749346374641e+01
1.957885142309403665527591540265083421123154118766194484116338865402421870038438e+01
2.537008100431492938594758173120782523596551601889930411223972698057345432324082e+01
3.460031509982099631679977958357837776172910961364789714103547775039539510037556e+01
5.064856634030538337039839892594914919243633180828954226948190245562885072384851e+01
8.235182086884441378840856376255774780426258585671432930491446269986001400929265e+01
1.593904552647182125308377757231958365456248837295405464512988882711449394962209e+02
4.390117906183980337973418729447434347126292248782133964769880485462139855137129e+02
3.934277448406249876105585619195395422788328735964810707337405408798242455345916e+03
So your estimate looks right.
5 Likes