Eigenvalues/Eigenvectors TODO
Concept
For a square matrix A, a nonzero vector v satisfying Av = λv is called an eigenvector, and the scalar λ is its eigenvalue — meaning the linear transformation doesn't change direction along v, only scales its magnitude by a factor of λ. Eigenvalues are found as the roots of the characteristic equation det(A - λI) = 0; if the eigenvectors form a basis for the space, A can be diagonalized as A = PDP^(-1), which simplifies computing powers of A to simply raising the diagonal entries to that power. A real symmetric matrix always has real eigenvalues and a basis of mutually orthogonal eigenvectors (the spectral theorem), and matrices commonly encountered in practice, like covariance matrices, fall into this category. The magnitude of the eigenvalues governs growth and decay under repeated application of the transformation, so whether the spectral radius is less than 1 determines whether an iterative process converges.
The stationary distribution of a Markov chain, dimensionality reduction via PCA, the convergence condition of iterative numerical solvers, and structural analysis of graphs all reduce to eigenvalue problems.
Code & Formula
# 고유값/고유벡터 — Av = λv 를 수치로 검증하고, 대각화 A=PDP^-1 로 A^n 계산을 단순화한다.
import numpy as np
A = np.array([[4.0, 1.0], [2.0, 3.0]])
eigvals, eigvecs = np.linalg.eig(A)
print("A =\n", A)
print(f"\n고유값: {eigvals}")
print("고유벡터(열 벡터):\n", eigvecs)
# 검증: 각 고유쌍에 대해 Av == λv
for i in range(len(eigvals)):
lam, v = eigvals[i], eigvecs[:, i]
lhs, rhs = A @ v, lam * v
print(f"\nλ_{i}={lam:.4f}: Av={lhs}, λv={rhs}, 일치? {np.allclose(lhs, rhs)}")
# 대각화: A = P D P^-1 → A^n = P D^n P^-1 (대각원소만 거듭제곱하면 됨)
P = eigvecs
D = np.diag(eigvals)
P_inv = np.linalg.inv(P)
n = 5
A_power_direct = np.linalg.matrix_power(A, n)
A_power_via_diag = (P @ np.diag(eigvals ** n) @ P_inv).real
print(f"\nA^{n} 직접 계산:\n{A_power_direct}")
print(f"A^{n} 대각화로 계산 (P D^{n} P^-1):\n{np.round(A_power_via_diag, 6)}")
print(f"일치? {np.allclose(A_power_direct, A_power_via_diag)}")
Exercise
Take a small transition matrix, repeatedly apply it, and observe the distribution converging — then check whether that limit matches the normalized eigenvector corresponding to eigenvalue 1.
Practical Connection
Eigendecomposing a covariance matrix built from multiple markets' prices or asset returns reveals that a small number of common factors explain most of the variation, which is used directly when aggregating the risk of correlated positions.
Where it lands in Jayverse
- Verex: eigendecompose the covariance matrix across correlated markets before aggregating position risk. Check for a dominant common factor rather than treating markets as independent when sizing combined risk.
- OFA: check the spectral radius of any iterative solver used in the clearing/matching step. If it isn't below 1 the iteration won't converge — test this on devnet before it ships, not after a stuck auction in production.
- Number: run PCA on the readings/indicator set before publishing one as an indicator. A component only earns a slot in the catalogue once it's checked against being just an artifact of input scaling.
Key expressions
| Expression | 뜻 · 쓰이는 자리 |
|---|---|
| spectral radius | 스펙트럴 반지름, 고유값 크기의 최댓값 · 반복 계산이 수렴하는지 판단하는 기준. "whether the spectral radius is less than 1" |
| diagonalize | 대각화하다 · 행렬을 대각행렬 형태로 분해해 계산을 단순화할 때. "A can be diagonalized as A = PDP^(-1)" |
| stationary distribution | 정상분포, 시간이 지나도 변하지 않는 분포 · 마르코프 체인이 수렴하는 최종 상태. "The stationary distribution of a Markov chain" |
| reduce to | ~로 귀결되다, 결국 ~문제로 환원되다 · 여러 다른 문제가 사실 같은 구조임을 말할 때. "all reduce to eigenvalue problems" |
| fall into (a category) | ~범주에 속하다 · 특정 성질을 만족하는 대상들을 묶어 말할 때. "fall into that category" |
| govern | 좌우하다, 지배하다 · 어떤 값이 전체 결과의 방향을 결정지을 때. "The magnitude of the eigenvalues governs growth and decay" |
| spectral theorem | 스펙트럴 정리 · 대칭행렬의 고유값·고유벡터에 관한 정리. "the spectral theorem" |
| PCA | 주성분분석(Principal Component Analysis) · 공분산행렬의 고유값 분해로 차원을 축소하는 기법. "dimensionality reduction via PCA" |
If you study this on a given day, add a note link and a ✅ to this line in the source curriculum (docs/knowledge/math-50-curriculum.md) and this spot will lead straight to the note body. You can also write directly on this page — but regenerating overwrites it, so it's safer to keep anything you want to save as markdown under docs/algorithms/.