Skip to content

incorrect eigenvalues/vectors? #89

Description

@Pomax

I was trying to figure out why none of the graphics I was plotting lined up correctly, and tracked it down to numeric.js not computing the correct eigenvalues and vectors. For example:

const M = [[11200, 5600], [5600, 4800]];
const eig = numeric.eig(M);
console.log(eig.lamba.x, eig.E.x);

yields:

(2) [14449.80619863884, 1550.1938013611607]
    0: 14449.80619863884
    1: 1550.1938013611607

(2) [Array(2), Array(2)]
    0: (2) [-0.8649100931185951, 0.5019268181932333]
    1: (2) [-0.5019268181932334, -0.8649100931185951]

but these eigenvectors seem to have the wrong sign for their [0] coordinate and should instead be:

(2) [Array(2), Array(2)]
    0: (2) [0.8649100931185951, 0.5019268181932333]
    1: (2) [0.5019268181932334, -0.8649100931185951]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions