Question

Consider the real, symmetric matrix

S = (2, 1; 1, 2)

From the characteristic equation |S - λ I|, we have the quadratic (2-λ)^2 - 1 = 0, whose solutions yield the eigenvalues 3 and 1. The corresponding eigenvectors are (1;-1) and (1;1).

octave:4> [V,lambda] = eig([2, 1; 1,2])
V =

  -0.70711   0.70711
   0.70711   0.70711

lambda =

Diagonal Matrix

   1   0
   0   3

Why are the eigenvectors in octave [-0.70711; 0.70711] and [0.70711; 0.70711]?

Was it helpful?

Solution

Given λ1 = 3 the corresponding eigenvector is:

| 2 1 |   |x|     |x|
|     | * | | = 3 | |   =>   x = y
| 1 2 |   |y|     |y|

I.e. any vector of the form [x, x]', for any non-zero real number x, is an eigenvector. So [0.70711, 0.70711]' is an eigenvector as valid as [1, 1]'.

Octave (but also Matlab) chooses the values such that the sum of the squares of the elements of each eigenvector equals unity (eigenvectors are normalized to have a norm of 1 and are chosen to be orthogonal, to be precise).

Of course the same is valid for λ2 = 1.

OTHER TIPS

In other words, V is one of the qr of [1 1; -1 1]

So you can check like this.

a = [1 1; -1 1]
[q,r] = qr(a)

q = 
   -0.70711  0.70711
    0.70711  0.70711

The result is the same as eig.

Manlio is correct, and here is why:

Any eigenvalue problem has an infinite number of eigenvectors. When you find an eigenvector by hand, what you actually calculate is a parameterized vector representing that infinite family of solutions. The elements of a specific eigenvector Octave (and most computer software) returns for a given eigenvalue can be used to form the orthonormal basis vectors of the eigenspace associated with that eigenvalue. Any linear combination of those basis vectors will be an eigenvector.

So, if you were expecting a different eigenvector, just check to make sure that it is linearly dependent on the basis vectors Octave computed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top