Forum Discussion
Eigen vectors/values with LAMBDAs
Hi, diegol_81 !
Yes, it is possible to use Lambda functions to calculate eigenvalues and eigenvectors. I have a project on GitHub that accomplishes that through recursion. What you need are functions EIGENVALUES and EIGENVECTORS of that project:
https://github.com/edugca/xlMATRIX
- diegol_81May 20, 2023Copper Contributor
Hi edugca,
Thank you for your reply! And sorry for the delay in response.
It was not until yesterday that I could have a look at the repertoire of formulae that you have developed, and I must say I am amazed! Congratulations on your terrific work!
That said, the EIGENVALUES() and EIGENVECTORS() formulas, as far as I could thest them, don't seem operative enough for my application (a matrix with dimension 18, and non-integral numbers -not sure if the latter could be causing trouble though). Most of the times, they do not produce all the eigenvalues/vectors (for a given set of parameters -eigenMin, eigenMax, eigenStep-, both produce the same number of eigenvectors as number of eigenvalues. But somehow they do not produce the full set, which R does). That's one big issue. The other issue is calc time, which can get very slow.
To tackle the first issue I tried playing with the eigenMin and eigenMax parameters to widen the interval the formulae sweep through; and with the eigenStep to make smaller increments, at the expense of performance, up to the point where runtime was clearly not viable (what I mean is, maybe there could be a smaller increment which would add way more steps and eventually produce the values/vectors, but I did not test thoroughly if runtime was already a no-go).
As far as I gathered from your lambda coding, the eigenvalues algorithm generates a vector of many candidates for eigenvalues. It then tests each one to see if they satisfy the characteristic equation
|A- candidate I | = 0. If it does, the candidate is an eigenvalue. But it goes beyond and also checks for sign changes in the LHS of the equation, as candidates are tested sequentially. In the event of a sign change, the candidate is regarded as an eigenvalue. I think I get the rationale, but for some reason it's not yielding all the eigenvalues.
I'll keep exploring it and upload an example file if still not successful.
Thanks!
Regards,
Diego