σμ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
  • 日本語
  • 中文
Linear Algebra skill›Module 3 · Spaces and geometry›Topic 3.2·~45 minIntermediate

Orthogonality and projections

Skill positionModule 3 of 4 · Topic 2 of 2
3.2 Orthogonality and projections
—Lab score— / 100Total XP—Streak—

Right angles and shadows

Two vectors are orthogonal when their dot product is zero, u⋅v=0\mathbf{u}\cdot\mathbf{v}=0u⋅v=0: they meet at a right angle. The length of u\mathbf{u}u is ∥u∥=u⋅u\|\mathbf{u}\|=\sqrt{\mathbf{u}\cdot\mathbf{u}}∥u∥=u⋅u​. Orthogonality is what makes geometry computable: Pythagoras holds, ∥u+v∥2=∥u∥2+∥v∥2\|\mathbf{u}+\mathbf{v}\|^2=\|\mathbf{u}\|^2+\|\mathbf{v}\|^2∥u+v∥2=∥u∥2+∥v∥2 when u⊥v\mathbf{u}\perp\mathbf{v}u⊥v, and uncorrelated returns are orthogonal once their means are removed.

p=a⋅ba⋅a a,(b−p)⋅a=0,P=aaTaTa\mathbf{p}=\frac{\mathbf{a}\cdot\mathbf{b}}{\mathbf{a}\cdot\mathbf{a}}\,\mathbf{a},\qquad (\mathbf{b}-\mathbf{p})\cdot\mathbf{a}=0,\qquad P=\frac{\mathbf{a}\mathbf{a}^{T}}{\mathbf{a}^{T}\mathbf{a}}p=a⋅aa⋅b​a,(b−p)⋅a=0,P=aTaaaT​(1)

The projection of b\mathbf{b}b onto the line through a\mathbf{a}a is its shadow p=c a\mathbf{p}=c\,\mathbf{a}p=ca, the closest point of the line to b\mathbf{b}b. The leftover b−p\mathbf{b}-\mathbf{p}b−p is orthogonal to a\mathbf{a}a, which fixes c=a⋅ba⋅ac=\frac{\mathbf{a}\cdot\mathbf{b}}{\mathbf{a}\cdot\mathbf{a}}c=a⋅aa⋅b​. A projection matrix PPP does this for every b\mathbf{b}b: p=Pb\mathbf{p}=P\mathbf{b}p=Pb, with PT=PP^{T}=PPT=P and P2=PP^2=PP2=P (projecting twice changes nothing). Its eigenvalues are only 0 and 1.

Projecting a pointProject b=(3,1)\mathbf{b}=(3,1)b=(3,1) onto a=(1,1)\mathbf{a}=(1,1)a=(1,1). Here a⋅b=4\mathbf{a}\cdot\mathbf{b}=4a⋅b=4 and a⋅a=2\mathbf{a}\cdot\mathbf{a}=2a⋅a=2, so c=2c=2c=2 and p=(2,2)\mathbf{p}=(2,2)p=(2,2). The leftover is b−p=(1,−1)\mathbf{b}-\mathbf{p}=(1,-1)b−p=(1,−1) and indeed (1,1)⋅(1,−1)=0(1,1)\cdot(1,-1)=0(1,1)⋅(1,−1)=0. The matrix is P=12(1111)P=\frac{1}{2}\begin{pmatrix}1&1\\1&1\end{pmatrix}P=21​(11​11​), and Pb=(2,2)P\mathbf{b}=(2,2)Pb=(2,2).
  • Orthogonal: u⋅v=0\mathbf{u}\cdot\mathbf{v}=0u⋅v=0. Orthonormal: orthogonal and each of length 1.
  • Projection: the closest point of a subspace; the leftover is orthogonal to the subspace.
  • Orthonormal columns (QTQ=IQ^{T}Q=IQTQ=I) keep lengths and angles, so they never amplify errors.
Residuals are the part the regressors cannot explainIn a regression the fitted values are the projection of the data vector y\mathbf{y}y onto the span of the regressors, and the residual is what is left, orthogonal to every regressor. That is why residuals have zero correlation with the factors in a fitted model, and why ∥y∥2=∥y^∥2+∥e∥2\|\mathbf{y}\|^2=\|\hat{\mathbf{y}}\|^2+\|\mathbf{e}\|^2∥y∥2=∥y^​∥2+∥e∥2 splits the variance into explained and unexplained parts.

Lab · what's graded

  • The projection coefficient15 pts
  • A projection matrix20 pts
  • The size of the leftover15 pts
  • Properties of projection matrices15 pts
  • Spot the orthogonal pair10 pts
  • Residuals and regressors25 pts
0/ 6 answered
Tasks
1Numeric answer15 ptsNot answered

Project b=(3,4)\mathbf{b}=(3,4)b=(3,4) onto the line through a=(2,1)\mathbf{a}=(2,1)a=(2,1), so p=c a\mathbf{p}=c\,\mathbf{a}p=ca. Find ccc.

c=c =c=accepted: ± 0.001
2Matrix · vector20 ptsNot answered

Fill in the matrix P=aaTaTaP=\dfrac{\mathbf{a}\mathbf{a}^{T}}{\mathbf{a}^{T}\mathbf{a}}P=aTaaaT​ that projects onto the line through a=(1,1)\mathbf{a}=(1,1)a=(1,1).

P=P =P=
3Numeric answer15 ptsNot answered

Projecting b=(3,1)\mathbf{b}=(3,1)b=(3,1) onto a=(1,1)\mathbf{a}=(1,1)a=(1,1) gives p=(2,2)\mathbf{p}=(2,2)p=(2,2). What is the length ∥b−p∥\|\mathbf{b}-\mathbf{p}\|∥b−p∥ of the leftover? Give it to three decimals.

∥b−p∥=\|\mathbf{b}-\mathbf{p}\| =∥b−p∥=accepted: ± 0.001
4Choice15 ptsNot answered

Select all the properties that a projection matrix PPP onto a line in the plane has.

5Choice10 ptsNot answered

Which pair of vectors is orthogonal?

6Explain in words25 ptsNot answered

In two sentences, explain why the residual of a least squares fit is orthogonal to every regressor, and what that says about the fitted values.

Math modeKeyboard or LaTeX inputTask 1 of 6 · 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