BRAGA

02 Writing02-02 Notes02-02-135

Characteristic Equation

Published 16 Apr 20267 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
  3. 03Real-world use
  4. 04The formula, piece by piece
  5. 05The formula in words
  6. 06Critical Concepts
  7. 07Step-by-step calculation (tiny example)
  8. 08Code examples
pA(λ)=det⁡(A−λI)=0p_A(\lambda) = \det(A - \lambda I) = 0
(1)

Deep Breakdown

What it tells me (Situation Awareness): The characteristic equation is the algebraic gateway to finding eigenvalues: you cannot get eigenvectors without it. In practice, you rarely solve this polynomial by hand for large matrices (libraries do it numerically), but you need to understand it to know why n×nn \times n matrices have at most nn eigenvalues, why symmetric matrices always have real eigenvalues, and how the determinant and trace connect to eigenvalues. In DA/DS this appears when you want to reason about the spectrum of a covariance matrix without computing all eigenvectors, or when checking if a matrix is positive definite by verifying all roots are positive.

Flowchart

Yes (e.g. symmetric A)NoInput: square n xn matrix AForm A - lambda* I (subtractlambda fromdiagonal)Compute det(A -lambda * I) =polynomial inlambda ofdegree nSet polynomial =0: characteristicequationp_A(lambda) = 0Solve for rootslambda_1, ...,lambda_n(countingmultiplicity)All roots real?Eigenvalues arelambda_1, ...,lambda_nComplexeigenvalue pairs(for realasymmetric A)For eachlambda_i, solve(A - lambda_i * I)x = 0 to geteigenvectors

Real-world use

Where it is used

You use the characteristic equation conceptually when analyzing a covariance matrix: if all roots of its characteristic polynomial are positive, the matrix is positive definite and Cholesky will work. You also use it when checking the stability of a dynamical system (all eigenvalues inside the unit circle means stable convergence), or when the trace and determinant of a 2×2 covariance block give you the eigenvalues analytically without a full solve.

Problem it solves

To find eigenvalues numerically, libraries use iterative algorithms (QR iteration), not this polynomial. But to understand how many eigenvalues exist, why they are real for symmetric matrices, and what the trace and determinant encode, you need the characteristic polynomial.

How it solves the problem

det⁡(A−λI)=0\det(A - \lambda I) = 0 says: find the values of λ\lambda for which A−λIA - \lambda I is singular, meaning there exists a non-zero vector xx with (A−λI)x=0(A - \lambda I)x = 0, i.e., Ax=λxAx = \lambda x. Expanding the determinant gives a degree-nn polynomial whose roots are precisely the eigenvalues.

Example in a business

A risk analyst has a 2×2 correlation matrix for two revenue streams. Rather than calling np.linalg.eig, they use the characteristic equation directly: for A=[1rr1]A = \begin{bmatrix}1 & r \\ r & 1\end{bmatrix}, pA(λ)=(1−λ)2−r2=0p_A(\lambda) = (1-\lambda)^2 - r^2 = 0, giving λ=1±∣r∣\lambda = 1 \pm |r|. If r=0.7r = 0.7, eigenvalues are 1.7 and 0.3, both positive so AA is PD. The dominant eigenvector (for λ=1.7\lambda = 1.7) points in the direction of maximum joint variance.

The formula, piece by piece

  • pA(λ)p_A(\lambda): the characteristic polynomial of AA, a polynomial of degree nn in λ\lambda
  • det⁡(⋅)\det(\cdot): the determinant, a scalar function of a square matrix
  • A−λIA - \lambda I: the matrix AA with λ\lambda subtracted from every diagonal entry; II is the identity matrix
  • =0= 0: we are looking for the values of λ\lambda that make this determinant zero, i.e., that make A−λIA - \lambda I singular
  • λ\lambda: the unknown eigenvalue, the root of the polynomial Full formula: pA(λ)=det⁡(A−λI)=0p_A(\lambda) = \det(A - \lambda I) = 0

The formula in words

"Find the values of λ\lambda for which subtracting λ\lambda from every diagonal entry of AA makes the matrix non-invertible." Tiny numeric example: A=[4123]A = \begin{bmatrix}4 & 1 \\ 2 & 3\end{bmatrix}. det⁡(A−λI)=(4−λ)(3−λ)−2=λ2−7λ+10=(λ−5)(λ−2)=0\det(A - \lambda I) = (4-\lambda)(3-\lambda) - 2 = \lambda^2 - 7\lambda + 10 = (\lambda-5)(\lambda-2) = 0. Eigenvalues: λ1=5\lambda_1 = 5, λ2=2\lambda_2 = 2. Sum =7=tr(A)= 7 = \text{tr}(A). Product =10=det⁡(A)= 10 = \det(A).

Critical Concepts

  • Trace-eigenvalue link: the sum of all eigenvalues equals tr(A)=∑Aii\text{tr}(A) = \sum A_{ii}; a quick sanity check on any eigenvalue computation.
  • Determinant-eigenvalue link: the product of all eigenvalues equals det⁡(A)\det(A); if any eigenvalue is 0, the matrix is singular.
  • Degree = size: the polynomial has degree nn, so exactly nn eigenvalues exist (counting complex and repeated roots by the fundamental theorem of algebra).
  • Symmetric matrices: A=ATA = A^T guarantees all roots of pAp_A are real (via spectral theorem); use np.linalg.eigh for speed and stability.
  • Repeated roots: a repeated eigenvalue (algebraic multiplicity >1> 1) may or may not yield enough independent eigenvectors (geometric multiplicity can be lower).
  • Never solve this for large matrices: for n>3n > 3, use np.linalg.eig or eigh; solving the degree-nn polynomial directly is numerically unstable.

Step-by-step calculation (tiny example)

Step 1: Form A - lambda I and write the determinant expression A=[5222]A = \begin{bmatrix}5 & 2 \\ 2 & 2\end{bmatrix}. Subtract λI\lambda I: A−λI=[5−λ222−λ]A - \lambda I = \begin{bmatrix}5-\lambda & 2 \\ 2 & 2-\lambda\end{bmatrix}. det⁡(A−λI)=(5−λ)(2−λ)−(2)(2)=10−7λ+λ2−4=λ2−7λ+6\det(A - \lambda I) = (5-\lambda)(2-\lambda) - (2)(2) = 10 - 7\lambda + \lambda^2 - 4 = \lambda^2 - 7\lambda + 6.

Step 2: Solve the characteristic polynomial for lambda λ2−7λ+6=0\lambda^2 - 7\lambda + 6 = 0. Discriminant: 49−24=2549 - 24 = 25. Roots: λ=7±52\lambda = \frac{7 \pm 5}{2}, giving λ1=6\lambda_1 = 6 and λ2=1\lambda_2 = 1.

Step 3: Verify using trace and determinant tr(A)=5+2=7=λ1+λ2=6+1\text{tr}(A) = 5 + 2 = 7 = \lambda_1 + \lambda_2 = 6 + 1. det⁡(A)=(5)(2)−(2)(2)=6=λ1⋅λ2=6⋅1\det(A) = (5)(2) - (2)(2) = 6 = \lambda_1 \cdot \lambda_2 = 6 \cdot 1. Both checks pass: eigenvalues are correct.

Code examples

Beginner example (Python)

python
import math

# -- Characteristic polynomial for a 2x2 matrix ----------------------
# A = [[a, b], [c, d]]
A_11 = 5.0
A_12 = 2.0
A_21 = 2.0
A_22 = 2.0

# Coefficients of lambda^2 - tr(A)*lambda + det(A) = 0
trace_a = A_11 + A_22
det_a = A_11 * A_22 - A_12 * A_21
print(f"tr(A) = {trace_a}")
print(f"det(A) = {det_a}")

# Solve lambda^2 - trace*lambda + det = 0
discriminant = trace_a ** 2 - 4 * det_a
print(f"Discriminant = {discriminant}")
if discriminant < 0:
    print("Complex eigenvalues (matrix is not symmetric with real eigenvalues)")
else:
    lambda_1 = (trace_a + math.sqrt(discriminant)) / 2
    lambda_2 = (trace_a - math.sqrt(discriminant)) / 2
    print(f"\nEigenvalues: lambda_1 = {lambda_1:.4f}, lambda_2 = {lambda_2:.4f}")
    print(f"Verification: sum = {lambda_1 + lambda_2:.4f} (should equal tr = {trace_a})")
    print(f"Verification: product = {lambda_1 * lambda_2:.4f} (should equal det = {det_a})")

Beginner example (R)

r
# -- Characteristic polynomial for a 2x2 matrix ----------------------
A <- matrix(c(5, 2, 2, 2), nrow = 2)
trace_a <- sum(diag(A))
det_a <- det(A)
cat(sprintf("tr(A) = %.4f\n", trace_a))
cat(sprintf("det(A) = %.4f\n", det_a))

# Solve lambda^2 - trace*lambda + det = 0
discriminant <- trace_a^2 - 4 * det_a
cat(sprintf("Discriminant = %.4f\n", discriminant))
if (discriminant >= 0) {
  lambda_1 <- (trace_a + sqrt(discriminant)) / 2
  lambda_2 <- (trace_a - sqrt(discriminant)) / 2
  cat(sprintf("Eigenvalues: %.4f, %.4f\n", lambda_1, lambda_2))
  cat(sprintf("Sum = %.4f (should equal trace = %.4f)\n", lambda_1 + lambda_2, trace_a))
  cat(sprintf("Product = %.4f (should equal det = %.4f)\n", lambda_1 * lambda_2, det_a))
}

Professional example (Python)

python
import numpy as np
import pandas as pd
np.random.seed(42)   # -- Business scenario: check positive definiteness of covariance blocks
# For a portfolio of 4 asset returns, check if each 2x2 sub-covariance
# block is positive definite using the characteristic equation analytically.
N_ASSETS = 4
N_PERIODS = 300
ASSET_NAMES = ["search_rev", "social_rev", "email_rev", "display_rev"]   # Simulate correlated weekly revenue increments (EUR thousands)
true_cov = np.array([ [4.0, 1.5, 0.8, 0.3], [1.5, 3.0, 1.0, 0.5], [0.8, 1.0, 2.5, 0.4], [0.3, 0.5, 0.4, 1.5],
])
L_sim = np.linalg.cholesky(true_cov)
returns = (np.random.normal(size=(N_PERIODS, N_ASSETS)) @ L_sim.T)
df = pd.DataFrame(returns, columns=ASSET_NAMES)
cov_matrix = df.cov().to_numpy()   # For each 2x2 sub-block, compute eigenvalues analytically via characteristic equation
results = []
for i in range(N_ASSETS):
    for j in range(i + 1, N_ASSETS):
        block = cov_matrix[np.ix_([i, j], [i, j])]
    trace_b = block[0, 0] + block[1, 1]
det_b = block[0, 0] * block[1, 1] - block[0, 1] * block[1, 0]
disc = trace_b ** 2 - 4 * det_b
lam_1 = (trace_b + np.sqrt(disc)) / 2
lam_2 = (trace_b - np.sqrt(disc)) / 2
is_pd = lam_1 > 0 and lam_2 > 0
results.append({ "pair": f"{ASSET_NAMES[i]} / {ASSET_NAMES[j]}", "lambda_1": round(lam_1, 4), "lambda_2": round(lam_2, 4), "is_positive_definite": is_pd, })
result_df = pd.DataFrame(results)
print("2x2 covariance block eigenvalues (via characteristic equation):")
print(result_df.to_string(index=False))
print("\nInterpretation: all blocks PD means each pair of assets has a valid covariance structure for Cholesky sampling.")

Source: 1300 p. 121

#linear-algebra#advanced-linear-algebra-and-decompositions#eigenvalues-eigenvectors-and-the-characteristic-polynomial

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close