σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Matrix Decompositions skill›Module 1 · Eigenvalues and spectra›Topic 1.2·~50 minIntermediate

Power iteration

Skill positionModule 1 of 5 · Topic 2 of 3
1.2 Power iteration
—Lab score— / 100Total XP—Streak—

Finding the dominant direction by repeated multiplication

Solving a characteristic polynomial is hopeless for a 1000×10001000\times10001000×1000 matrix, and often only the largest eigenpair is wanted, for example the first principal component. Power iteration finds it with nothing but matrix-vector products. Start from any vector x0\mathbf x_0x0​ and repeat xk+1=Axk/∥Axk∥\mathbf x_{k+1}=A\mathbf x_k/\lVert A\mathbf x_k\rVertxk+1​=Axk​/∥Axk​∥. Each multiplication stretches the component along the dominant eigenvector more than every other component, so after enough steps the vector points along it.

xk+1=Axk∥Axk∥,λ≈xkTAxkxkTxk,ek∝∣λ2λ1∣k\mathbf x_{k+1}=\frac{A\mathbf x_k}{\lVert A\mathbf x_k\rVert},\qquad \lambda\approx\frac{\mathbf x_k^{T}A\mathbf x_k}{\mathbf x_k^{T}\mathbf x_k},\qquad e_k\propto\Big|\frac{\lambda_2}{\lambda_1}\Big|^{k}xk+1​=∥Axk​∥Axk​​,λ≈xkT​xk​xkT​Axk​​,ek​∝​λ1​λ2​​​k(1)

Write x0=c1v1+c2v2+⋯\mathbf x_0=c_1\mathbf v_1+c_2\mathbf v_2+\cdotsx0​=c1​v1​+c2​v2​+⋯ in eigenvectors. After kkk steps the coefficients are multiplied by λik\lambda_i^kλik​, so the ratio of the second to the first is (λ2/λ1)k(\lambda_2/\lambda_1)^k(λ2​/λ1​)k. The method converges when ∣λ1∣>∣λ2∣|\lambda_1|>|\lambda_2|∣λ1​∣>∣λ2​∣ and the starting vector has some component along v1\mathbf v_1v1​, and the speed is set by ∣λ2/λ1∣|\lambda_2/\lambda_1|∣λ2​/λ1​∣: close eigenvalues mean slow convergence. The normalisation only stops the numbers from overflowing; the direction is what matters. The eigenvalue estimate is the Rayleigh quotient. For the next eigenpair subtract λ1v1v1T\lambda_1\mathbf v_1\mathbf v_1^{T}λ1​v1​v1T​ from a symmetric AAA and repeat, which is called deflation.

A few steps by handTake A=(2112)A=\begin{pmatrix}2&1\\1&2\end{pmatrix}A=(21​12​), whose eigenvalues are 3 and 1 with dominant eigenvector (1,1)(1,1)(1,1). Start at x0=(1,0)\mathbf x_0=(1,0)x0​=(1,0). Then Ax0=(2,1)A\mathbf x_0=(2,1)Ax0​=(2,1), and the Rayleigh quotient of (2,1)(2,1)(2,1) is (2,1)⋅(5,4)5=145=2.8\frac{(2,1)\cdot(5,4)}{5}=\frac{14}{5}=2.85(2,1)⋅(5,4)​=514​=2.8, already close to 3. The next product is A(2,1)=(5,4)A(2,1)=(5,4)A(2,1)=(5,4), pointing nearly along (1,1)(1,1)(1,1). The error shrinks by ∣λ2/λ1∣=1/3|\lambda_2/\lambda_1|=1/3∣λ2​/λ1​∣=1/3 per step, so to gain a factor 10−610^{-6}10−6 you need kkk with 3k≥1063^k\ge10^63k≥106, which is k=13k=13k=13.
  • Update: multiply by AAA, divide by the norm, repeat; each step costs one matrix-vector product.
  • Speed: the error falls like ∣λ2/λ1∣k|\lambda_2/\lambda_1|^k∣λ2​/λ1​∣k, so close top eigenvalues converge slowly.
  • Needs: a gap ∣λ1∣>∣λ2∣|\lambda_1|>|\lambda_2|∣λ1​∣>∣λ2​∣ and a start vector not orthogonal to v1\mathbf v_1v1​.
The same idea ranks web pagesPower iteration is the method behind PageRank, and it is how a first principal component of thousands of assets is computed cheaply when the covariance matrix is huge or never formed explicitly (only products AxA\mathbf xAx are available). Library routines for the full decomposition cost about n3n^3n3 operations, while each power step costs n2n^2n2 for a dense matrix.

Lab · what's graded

  • What it converges to15 pts
  • A Rayleigh quotient20 pts
  • The convergence ratio10 pts
  • How many iterations15 pts
  • The algorithm in order15 pts
  • When it is slow or fails15 pts
  • Why normalise10 pts
0/ 7 answered
Tasks
1Choice15 ptsNot answered

When ∣λ1∣>∣λ2∣|\lambda_1|>|\lambda_2|∣λ1​∣>∣λ2​∣, power iteration on a matrix converges (in direction) to which vector?

2Numeric answer20 ptsNot answered

For A=(2112)A=\begin{pmatrix}2&1\\1&2\end{pmatrix}A=(21​12​) and x=(2,1)\mathbf x=(2,1)x=(2,1) compute xTAx / xTx\mathbf x^{T}A\mathbf x\,/\,\mathbf x^{T}\mathbf xxTAx/xTx.

Rayleighquotient=Rayleigh quotient =Rayleighquotient=accepted: ± 0.01
3Numeric answer10 ptsNot answered

A matrix has eigenvalues 3 and 1. By what factor does the error shrink in each power step?

ratio=ratio =ratio=accepted: ± 0.005
4Numeric answer15 ptsNot answered

With a ratio of 1/3 per step, what is the smallest whole number of steps kkk that shrinks the error by a factor of at least 10610^{6}106 (that is, 3k≥1063^k\ge10^63k≥106)?

k=k =k=accepted: ± 0.01
5Order the steps15 ptsNot answered

Put the steps of power iteration in order.

Drag to reorder, or focus an item, press Space to lift it, the arrow keys to move it and Space to drop it.

  1. 1Divide by the norm to get a unit vector
  2. 2Report the Rayleigh quotient as the eigenvalue
  3. 3Start from a non-zero vector
  4. 4Repeat until the direction stops changing
  5. 5Multiply the vector by the matrix
6Choice15 ptsNot answered

Select every situation in which plain power iteration converges slowly or does not converge.

7Explain in words10 ptsNot answered

In one or two sentences, say why we divide by the norm after each multiplication.

Math modeKeyboard or LaTeX inputTask 1 of 7 · Ctrl ⏎ to check

Log in to run your code.

Every lecture is free to read. Create an account or log in to run code, run tests and submit this lab.

  • In-browser IDE with a bash terminal — nothing to install
  • Instant grading, XP and your place on the skill
Create an accountLog in
OR
Continue with GitHub