σμ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
  • 日本語
  • 中文
Bayesian Inference skill›Module 3 · Models and practice›Topic 3.3·~55 minAdvanced

Bayesian updating of strategy performance

Skill positionModule 3 of 3 · Topic 3 of 4
3.3 Bayesian updating of strategy performance
—Lab score— / 100Total XP—Streak—

Yesterday's posterior is today's prior

A strategy comes with a back-test and then with live results. Bayesian updating handles both in one way. Start with a prior: what the back-test says about the strategy's yearly edge, with its uncertainty. When a new period of live results arrives, update. The posterior becomes the prior for the next period. Updating one period at a time gives exactly the same answer as updating once with all the data, and the order of the periods does not matter. That makes it natural for a live system that learns every day.

Pk=Pk−1+1s2,mk=Pk−1 mk−1+yk/s2PkP_{k}=P_{k-1}+\frac{1}{s^{2}},\qquad m_{k}=\frac{P_{k-1}\,m_{k-1}+y_k/s^{2}}{P_{k}}Pk​=Pk−1​+s21​,mk​=Pk​Pk−1​mk−1​+yk​/s2​(1)

Here PPP is the precision of the belief, mmm its mean, yky_kyk​ the result of period kkk and sss its standard error. One more idea matters for markets: they change. A strategy's edge today may differ from its edge five years ago, so very old results can mislead. A forgetting factor δ\deltaδ slightly below 111 multiplies the precision by δ\deltaδ before each update, which widens the belief a little and lets old results fade. The price is that the belief never becomes extremely sure, which is honest when the world keeps moving.

A back-test meets two live yearsThe back-test says an edge of 6%6\%6% a year with uncertainty 4%4\%4%, so the prior precision is 1/16=0.06251/16=0.06251/16=0.0625. Live year 1 returns 2%2\%2% with standard error 5%5\%5%, precision 0.040.040.04. The posterior has precision 0.10250.10250.1025, mean (0.0625×6+0.04×2)/0.1025=4.44%(0.0625\times6+0.04\times2)/0.1025=4.44\%(0.0625×6+0.04×2)/0.1025=4.44% and standard deviation 3.12%3.12\%3.12%. Live year 2 returns 1%1\%1%. Update again: precision 0.14250.14250.1425, mean 3.47%3.47\%3.47%, standard deviation 2.65%2.65\%2.65%. All at once, with mean 1.5%1.5\%1.5% and standard error 3.54%3.54\%3.54%, gives the same 3.47%3.47\%3.47%. The chance that the edge is above zero is now 0.9050.9050.905.
  • Sequential updating: yesterday's posterior is today's prior. One period at a time equals all at once.
  • Back-test as a prior: it is a starting belief with an honest uncertainty, not a fact.
  • Forgetting factor δ<1\delta<1δ<1: shrinks the precision before each update so old results fade.

Lab · what's graded

  • After the first live year15 pts
  • The spread after year one10 pts
  • After the second live year15 pts
  • The chance of a positive edge15 pts
  • Forgetting old results10 pts
  • Does the order matter?10 pts
  • Match the vocabulary10 pts
  • Why forget old results15 pts
0/ 8 answered
Tasks
1Numeric answer15 ptsNot answered

The prior is 6%6\%6% with precision 0.06250.06250.0625. Live year 1 gives 2%2\%2% with precision 0.040.040.04. What is the posterior mean (0.0625×6+0.04×2)/0.1025(0.0625\times6+0.04\times2)/0.1025(0.0625×6+0.04×2)/0.1025, in percent? Give two decimals.

m=m =m=accepted: ± 0.02
2Numeric answer10 ptsNot answered

The posterior precision is 0.10250.10250.1025. What is the posterior standard deviation 1/0.10251/\sqrt{0.1025}1/0.1025​, in percent? Give two decimals.

s=s =s=accepted: ± 0.02
3Numeric answer15 ptsNot answered

Now the prior is the last posterior (mean 4.44%4.44\%4.44%, precision 0.10250.10250.1025) and live year 2 gives 1%1\%1% with precision 0.040.040.04. What is the new posterior mean (0.1025×4.44+0.04×1)/0.1425(0.1025\times4.44+0.04\times1)/0.1425(0.1025×4.44+0.04×1)/0.1425, in percent? Give two decimals.

m=m =m=accepted: ± 0.02
4Numeric answer15 ptsNot answered

The posterior is N(3.47%, 2.65%)N(3.47\%,\ 2.65\%)N(3.47%, 2.65%). What is P(m>0)=Φ(3.47/2.65)=Φ(1.31)P(m>0)=\Phi(3.47/2.65)=\Phi(1.31)P(m>0)=Φ(3.47/2.65)=Φ(1.31)? Give three decimals.

p=p =p=accepted: ± 0.004
5Numeric answer10 ptsNot answered

Before the next update, apply a forgetting factor δ=0.9\delta=0.9δ=0.9 to the precision 0.10250.10250.1025. What is the new precision 0.9×0.10250.9\times0.10250.9×0.1025? Give five decimals.

d=d =d=accepted: ± 0.00003
6Choice10 ptsNot answered

You update with year 1 then year 2, or with year 2 then year 1, with no forgetting. What is the difference in the final posterior?

7Match10 ptsNot answered

Match each term with its meaning.

Pick the partner of each item on the left.

Sequential updating
Back-test prior
Forgetting factor
Live results
8Explain in words15 ptsNot answered

In one or two sentences, explain why a trader may want a forgetting factor when updating beliefs about a strategy.

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