σμ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
  • 日本語
  • 中文
Statistics skill›Module 1 · Describing and estimating›Topic 1.3·~55 minIntermediate

Confidence intervals and the bootstrap

Skill positionModule 1 of 4 · Topic 3 of 3
1.3 Confidence intervals and the bootstrap
—Lab score— / 100Total XP—Streak—

How precise is an estimate

A point estimate such as a mean return says nothing about its reliability. A confidence interval adds it: for a mean, xˉ±t∗ s/n\bar x\pm t^{*}\,s/\sqrt{n}xˉ±t∗s/n​, where t∗t^{*}t∗ is the critical value of the ttt distribution with n−1n-1n−1 degrees of freedom (about 2.06 for 95% and n=25n=25n=25, tending to 1.96 for large nnn). For a proportion the interval is p^±1.96p^(1−p^)/n\hat p\pm1.96\sqrt{\hat p(1-\hat p)/n}p^​±1.96p^​(1−p^​)/n​. The width is set by the standard error and the confidence level, and it shrinks only like 1/n1/\sqrt{n}1/n​.

[θ^(2.5%)∗, θ^(97.5%)∗],θ^1∗,…,θ^B∗\left[\hat\theta^{*}_{(2.5\%)},\ \hat\theta^{*}_{(97.5\%)}\right],\qquad \hat\theta^{*}_{1},\dots,\hat\theta^{*}_{B}[θ^(2.5%)∗​, θ^(97.5%)∗​],θ^1∗​,…,θ^B∗​(1)

Many statistics have no simple standard-error formula: a median, a Sharpe ratio, a drawdown, a ratio of two means. The bootstrap gets around that. Resample the observed data with replacement to make a new sample of the same size, compute the statistic on it, repeat thousands of times, and read the interval off the percentiles of the resulting values. It treats the sample as a stand-in for the population. It needs care when observations are dependent (resample blocks of consecutive days, not single days) and it cannot rescue a tiny sample.

Two intervalsA mean from n=25n=25n=25 days with s=2%s=2\%s=2% has standard error 2/5=0.4%2/5=0.4\%2/5=0.4%, and the 95% interval is the mean ±2.064⋅0.4=±0.826%\pm2.064\cdot0.4=\pm0.826\%±2.064⋅0.4=±0.826%. In a survey of 400 trades, 55% won: the interval for the win rate is 0.55±1.960.55⋅0.45/400≈0.55±0.0490.55\pm1.96\sqrt{0.55\cdot0.45/400}\approx0.55\pm0.0490.55±1.960.55⋅0.45/400​≈0.55±0.049, so from about 50.1% to 59.9%: barely above a coin flip. With 2,000 bootstrap resamples, the 2.5th and 97.5th percentiles are the 50th smallest and the 50th largest values.
  • Confidence interval for a mean: estimate ±\pm± critical value ×\times× standard error.
  • Bootstrap: resample with replacement, recompute, repeat, take percentiles; no formula needed.
  • Dependent data: resample blocks of consecutive days so that autocorrelation survives.
What a 95% interval does not sayIt does not mean the true value lies in this particular interval with 95% probability. The true value is fixed; the interval is random. The 95% describes the procedure: if you repeated the study many times and built an interval each time, about 95% of those intervals would contain the truth. The honest summary of one interval is its range, not a probability.

Lab · what's graded

  • An interval for a mean15 pts
  • An interval for a proportion15 pts
  • The steps of a bootstrap15 pts
  • What 95% means15 pts
  • Facts about the bootstrap15 pts
  • Reading the percentile10 pts
  • Why the bootstrap needs no formula15 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

A mean of n = 25 daily returns has sample standard deviation 2%. With the t critical value 2.064 (24 degrees of freedom), what is the half-width of the 95% confidence interval, in percent? Give it to three decimals.

h=h =h=accepted: ± 0.005
2Numeric answer15 ptsNot answered

In 400 trades, 55% were winners. What is the half-width of the 95% confidence interval for the win rate, using 1.96? Give it to four decimals.

h=h =h=accepted: ± 0.0005
3Order the steps15 ptsNot answered

Put the steps of a percentile bootstrap interval 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. 1Take the 2.5th and 97.5th percentiles of the statistics
  2. 2Compute the statistic on that resample
  3. 3Draw a resample of the same size with replacement
  4. 4Repeat many times, for example 2,000
4Choice15 ptsNot answered

What does a 95% confidence interval mean?

5Choice15 ptsNot answered

Select every true statement.

6Numeric answer10 ptsNot answered

With 2,000 bootstrap values sorted from smallest to largest, which position (counting from 1) holds the 2.5th percentile, the lower end of a 95% interval?

k=k =k=accepted: ± 0.001
7Explain in words15 ptsNot answered

In two sentences, explain how the bootstrap gives a confidence interval for a Sharpe ratio.

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