固有値と固有ベクトル

行列変換で“向きは変わらず伸び縮みだけする方向”として、固有値と固有ベクトルを直感的に理解します。

Linear AlgebraEigenvaluesPCA

はじめに

固有値・固有ベクトルは、行列が空間をどう変換するかを理解するための中心概念です。

行列 AA に対して

Av=λvA\mathbf{v}=\lambda\mathbf{v}

を満たすとき、v\mathbf{v} は固有ベクトル、λ\lambda は固有値です。

意味はシンプルで、方向は保たれたまま、長さだけが λ\lambda 倍されるということです。

1. 幾何学的な直感

一般のベクトルは行列変換で向きも長さも変わりますが、固有ベクトルは特別です。

  • 向き(符号を除く)は変わらない
  • 長さだけが λ|\lambda|
  • λ<0\lambda<0 なら反転も起きる

2. 求め方

固有値は次の特性方程式の解です。

det(AλI)=0\det(A-\lambda I)=0

各固有値 λ\lambda に対して

(AλI)v=0(A-\lambda I)\mathbf{v}=\mathbf{0}

を解くと固有ベクトルが得られます。

3. なぜ重要か

  • 行列の対角化により計算が簡単になる
  • 力学系の安定性解析に使える
  • PCAでは「分散が最大の方向」を固有ベクトルで表せる

4. 2次元でのイメージ

2次元では、単位円を行列で変換すると楕円になります。

  • 楕円の主軸方向が固有ベクトル
  • 主軸方向の伸縮率が固有値

この対応を見ると、線形代数とデータ解析のつながりが直感的に分かります。

インタラクティブデモ

下のデモでは行列成分を変えながら、ベクトルがどう変換されるか、どの方向が固有ベクトルになるかを確認できます。

Eigenvalues and Eigenvectors Demo

Watch how regular vectors change both direction and length, while eigenvectors only change length!

v1(2, 0)v2(0, 2)v3(-1, 1)v4(1, -2)e1(1, 1)e2(1, -1)

Legend:

Regular vectors (direction and length change)
Eigenvectors (only length changes)

Transformation Matrix:

[3, 1]
[1, 3]

Eigenvalues:

λ₁ = 4(for eigenvector (1,1))
λ₂ = 2(for eigenvector (1,-1))

🧮 Try calculating by hand:

Matrix A × vector v₁ = [3,1; 1,3] × [1,0]
= [3×1+1×0, 1×1+3×0] = [3,1]
Matrix A × eigenvector e₁ = [3,1; 1,3] × [1,1]
= [3×1+1×1, 1×1+3×1] = [4,4] = 4×[1,1]
→ Direction unchanged, scaled by λ₁=4!

🔑 Key Insight:

When you apply the transformation, notice that the red eigenvectorskeep pointing in the same direction but change length by their eigenvalue factor. The gray regular vectors change both direction and length.

まとめ

  • 固有ベクトルは「向きが保たれる特別な方向」。
  • 固有値はその方向での伸縮率(符号付き)。
  • PCA・微分方程式・最適化など、多くの分野で基礎となる。
← 図鑑に戻る