σμ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 1 · Beliefs and evidence›Topic 1.3·~45 minIntermediate

Posterior intervals and decisions

Skill positionModule 1 of 3 · Topic 3 of 4
1.3 Posterior intervals and decisions
—Lab score— / 100Total XP—Streak—

Saying how sure you are

The posterior is a whole spread of beliefs, so you can answer questions with probabilities. A 95%95\%95% credible interval is a range that holds the true value with 95%95\%95% probability, given your prior and the data. This is the plain sentence people wrongly attach to ordinary confidence intervals. For the normal posterior N(9.66%, 3.12%)N(9.66\%,\,3.12\%)N(9.66%,3.12%) the interval is the mean plus or minus 1.961.961.96 standard deviations: [3.5%, 15.8%][3.5\%,\ 15.8\%][3.5%, 15.8%]. For the win rate Beta(19,11)\mathrm{Beta}(19,11)Beta(19,11) it is [0.46, 0.79][0.46,\ 0.79][0.46, 0.79], and it is not symmetric around the mean.

[μn−1.96 τn, μn+1.96 τn],P(μ>c)=1−Φ ⁣(c−μnτn)[\mu_n-1.96\,\tau_n,\ \mu_n+1.96\,\tau_n],\qquad P(\mu>c)=1-\Phi\!\left(\frac{c-\mu_n}{\tau_n}\right)[μn​−1.96τn​, μn​+1.96τn​],P(μ>c)=1−Φ(τn​c−μn​​)(1)

You can also ask for the probability of exactly what you care about, such as P(μ>c)P(\mu>c)P(μ>c). A decision needs one more thing: what it costs to be wrong. Say the strategy pays off +2+2+2 units if it is good and loses 101010 units if it is not. With a posterior chance of 0.930.930.93 that it is good, the expected result is 0.93×2−0.07×10=1.160.93\times2-0.07\times10=1.160.93×2−0.07×10=1.16, so you trade. If the chance were 0.800.800.80 you would get 0.8×2−0.2×10=−0.40.8\times2-0.2\times10=-0.40.8×2−0.2×10=−0.4 and stay out. The best single guess depends on how you score mistakes: the posterior mean is best for squared errors and the median for absolute errors.

Reading the numbersFrom the posterior N(9.66%, 3.12%)N(9.66\%,\,3.12\%)N(9.66%,3.12%): the 95%95\%95% interval is 9.66±1.96×3.129.66\pm1.96\times3.129.66±1.96×3.12, which is [3.54%, 15.78%][3.54\%,\ 15.78\%][3.54%, 15.78%]. The chance that the mean return beats 5%5\%5% is Φ((9.66−5)/3.12)=Φ(1.49)=0.932\Phi\big((9.66-5)/3.12\big)=\Phi(1.49)=0.932Φ((9.66−5)/3.12)=Φ(1.49)=0.932. The chance that it is above 000 is 0.9990.9990.999. So you are almost sure the strategy earns something, and about 93%93\%93% sure it earns more than 5%5\%5%.
  • Credible interval: a range holding the true value with the stated probability, given prior and data.
  • Tail probabilities such as P(μ>c)P(\mu>c)P(μ>c) answer the question you actually have.
  • Decisions: average the payoff over the posterior and take the action with the best expected result.

Lab · what's graded

  • The lower end15 pts
  • The upper end15 pts
  • A tail probability15 pts
  • The expected result of a bet15 pts
  • Reading a credible interval10 pts
  • Match the vocabulary15 pts
  • Short record, wide interval15 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

The posterior is N(9.66%, 3.12%)N(9.66\%,\,3.12\%)N(9.66%,3.12%). What is the lower end of the 95%95\%95% credible interval, 9.66−1.96×3.129.66-1.96\times3.129.66−1.96×3.12, in percent? Give two decimals.

lo=lo =lo=accepted: ± 0.03
2Numeric answer15 ptsNot answered

What is the upper end of the same interval, 9.66+1.96×3.129.66+1.96\times3.129.66+1.96×3.12, in percent? Give two decimals.

hi=hi =hi=accepted: ± 0.03
3Numeric answer15 ptsNot answered

What is the posterior chance that the mean return is above 5%5\%5%? Compute z=(9.66−5)/3.12z=(9.66-5)/3.12z=(9.66−5)/3.12 and then Φ(z)\Phi(z)Φ(z) with a table or a calculator. Give three decimals.

p=p =p=accepted: ± 0.004
4Numeric answer15 ptsNot answered

A strategy gains 222 units if it is good and loses 101010 if it is not. The posterior chance that it is good is 0.930.930.93. What is the expected result?

ev=ev =ev=accepted: ± 0.01
5Choice10 ptsNot answered

Which sentence correctly describes a 95% credible interval of [3.5%, 15.8%] for a mean return?

6Match15 ptsNot answered

Match each term with its meaning.

Pick the partner of each item on the left.

95% credible interval
P(μ>c)P(\mu>c)P(μ>c)
Posterior mean
Posterior median
7Explain in words15 ptsNot answered

In one or two sentences, explain why one year of returns gives a much wider credible interval for a mean return than twenty years do.

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