σμ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
  • 日本語
  • 中文
Probability skill›Module 2 · Random variables and distributions›Topic 2.2·~45 minBeginner

Expectation and covariance

Skill positionModule 2 of 5 · Topic 2 of 3
2.2 Expectation and covariance
—Lab score— / 100Total XP—Streak—

Averages, spread and co-movement

The expectation of a random variable is its probability-weighted average, E[X]=∑ixi piE[X]=\sum_i x_i\,p_iE[X]=∑i​xi​pi​. It is linear: E[aX+bY+c]=aE[X]+bE[Y]+cE[aX+bY+c]=aE[X]+bE[Y]+cE[aX+bY+c]=aE[X]+bE[Y]+c, always, whether or not XXX and YYY are independent. The variance measures spread around the mean, Var⁡(X)=E[(X−E[X])2]=E[X2]−E[X]2\operatorname{Var}(X)=E\big[(X-E[X])^2\big]=E[X^2]-E[X]^2Var(X)=E[(X−E[X])2]=E[X2]−E[X]2, and the standard deviation σ=Var⁡(X)\sigma=\sqrt{\operatorname{Var}(X)}σ=Var(X)​ has the same units as XXX.

Cov⁡(X,Y)=E[XY]−E[X]E[Y],ρ=Cov⁡(X,Y)σXσY\operatorname{Cov}(X,Y)=E[XY]-E[X]E[Y],\qquad \rho=\frac{\operatorname{Cov}(X,Y)}{\sigma_X\sigma_Y}Cov(X,Y)=E[XY]−E[X]E[Y],ρ=σX​σY​Cov(X,Y)​(1)

Covariance measures co-movement: positive when XXX and YYY tend to be above their means together. Correlation ρ\rhoρ rescales it to lie between −1-1−1 and 111. Variances add only when covariance is zero: in general Var⁡(X+Y)=Var⁡(X)+Var⁡(Y)+2Cov⁡(X,Y)\operatorname{Var}(X+Y)=\operatorname{Var}(X)+\operatorname{Var}(Y)+2\operatorname{Cov}(X,Y)Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y). For a portfolio with weights wiw_iwi​ this is the quadratic form Var⁡=∑i,jwiwjCov⁡(Ri,Rj)=wTΣw\operatorname{Var}=\sum_{i,j}w_iw_j\operatorname{Cov}(R_i,R_j)=\mathbf{w}^{T}\Sigma\mathbf{w}Var=∑i,j​wi​wj​Cov(Ri​,Rj​)=wTΣw.

A discrete return and a two-asset portfolioA return (in percent) is −2-2−2, 111 or 444 with probabilities 0.20.20.2, 0.50.50.5, 0.30.30.3. Then E[X]=−0.4+0.5+1.2=1.3E[X]=-0.4+0.5+1.2=1.3E[X]=−0.4+0.5+1.2=1.3, E[X2]=0.8+0.5+4.8=6.1E[X^2]=0.8+0.5+4.8=6.1E[X2]=0.8+0.5+4.8=6.1 and Var⁡(X)=6.1−1.32=4.41\operatorname{Var}(X)=6.1-1.3^2=4.41Var(X)=6.1−1.32=4.41, so σ=2.1\sigma=2.1σ=2.1. Now split money 50/50 between assets with σ1=0.2\sigma_1=0.2σ1​=0.2, σ2=0.3\sigma_2=0.3σ2​=0.3 and ρ=0.5\rho=0.5ρ=0.5: Var⁡=0.25(0.04)+0.25(0.09)+2(0.25)(0.5)(0.2)(0.3)=0.0475\operatorname{Var}=0.25(0.04)+0.25(0.09)+2(0.25)(0.5)(0.2)(0.3)=0.0475Var=0.25(0.04)+0.25(0.09)+2(0.25)(0.5)(0.2)(0.3)=0.0475, so σp≈0.218\sigma_p\approx0.218σp​≈0.218, below the average of 0.25.
  • Expectation is linear, with or without independence.
  • Variance: E[X2]−E[X]2E[X^2]-E[X]^2E[X2]−E[X]2; Var⁡(aX+b)=a2Var⁡(X)\operatorname{Var}(aX+b)=a^2\operatorname{Var}(X)Var(aX+b)=a2Var(X).
  • Covariance and correlation measure co-movement; Cov⁡(X,X)=Var⁡(X)\operatorname{Cov}(X,X)=\operatorname{Var}(X)Cov(X,X)=Var(X).
Zero correlation is not independenceIndependent variables have zero covariance, but not the other way round. If XXX is symmetric around 0 and Y=X2Y=X^2Y=X2, then Cov⁡(X,Y)=0\operatorname{Cov}(X,Y)=0Cov(X,Y)=0 although YYY is completely determined by XXX. Correlation only sees linear co-movement; a market that is calm until it crashes can have low correlation and strong dependence in the tails.

Lab · what's graded

  • The expected return15 pts
  • The variance15 pts
  • A covariance10 pts
  • A portfolio variance20 pts
  • Which rules are true15 pts
  • A correlation10 pts
  • Why diversification works15 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

A return (in percent) is -2, 1 or 4 with probabilities 0.2, 0.5 and 0.3. Compute the expected value E[X]E[X]E[X].

E[X]=E[X] =E[X]=accepted: ± 0.001
2Numeric answer15 ptsNot answered

A return (in percent) is -2, 1 or 4 with probabilities 0.2, 0.5 and 0.3. Compute Var⁡(X)=E[X2]−E[X]2\operatorname{Var}(X)=E[X^2]-E[X]^2Var(X)=E[X2]−E[X]2.

Var⁡(X)=\operatorname{Var}(X) =Var(X)=accepted: ± 0.005
3Numeric answer10 ptsNot answered

For two returns, E[X]=1E[X]=1E[X]=1, E[Y]=2E[Y]=2E[Y]=2 and E[XY]=3E[XY]=3E[XY]=3. Find Cov⁡(X,Y)\operatorname{Cov}(X,Y)Cov(X,Y).

Cov⁡=\operatorname{Cov} =Cov=accepted: ± 0.001
4Numeric answer20 ptsNot answered

Two assets have σ1=0.2\sigma_1=0.2σ1​=0.2, σ2=0.3\sigma_2=0.3σ2​=0.3 and correlation ρ=0.5\rho=0.5ρ=0.5. Compute the variance of a 50/50 portfolio. Give it to four decimals.

σp2=\sigma_p^{2} =σp2​=accepted: ± 0.0002
5Choice15 ptsNot answered

Select every rule that always holds.

6Numeric answer10 ptsNot answered

Cov⁡(X,Y)=0.9\operatorname{Cov}(X,Y)=0.9Cov(X,Y)=0.9, σX=1.5\sigma_X=1.5σX​=1.5 and σY=1.0\sigma_Y=1.0σY​=1.0. Find the correlation ρ\rhoρ.

ρ=\rho =ρ=accepted: ± 0.001
7Explain in words15 ptsNot answered

In two sentences, explain why a portfolio of two assets that are not perfectly correlated has less risk than the average of the two.

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