σμ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
  • 日本語
  • 中文
Time Series skill›Module 2 · Models for the mean›Topic 2.1·~55 minIntermediate

AR MA and ARMA models

Skill positionModule 2 of 5 · Topic 1 of 3
2.1 AR MA and ARMA models
—Lab score— / 100Total XP—Streak—

Building blocks for the mean

An autoregression of order ppp, AR(ppp), explains a value by its own past: xt=c+φ1xt−1+⋯+φpxt−p+εtx_t=c+\varphi_1x_{t-1}+\dots+\varphi_px_{t-p}+\varepsilon_txt​=c+φ1​xt−1​+⋯+φp​xt−p​+εt​. It is stationary when its coefficients keep it from exploding, which for AR(1) means ∣φ∣<1|\varphi|<1∣φ∣<1, and its mean is μ=c/(1−∑φi)\mu=c/(1-\sum\varphi_i)μ=c/(1−∑φi​). A moving average of order qqq, MA(qqq), explains a value by past shocks: xt=μ+εt+θ1εt−1+⋯+θqεt−qx_t=\mu+\varepsilon_t+\theta_1\varepsilon_{t-1}+\dots+\theta_q\varepsilon_{t-q}xt​=μ+εt​+θ1​εt−1​+⋯+θq​εt−q​. It is always stationary and has a memory of exactly qqq steps. Combining both gives ARMA(p,qp,qp,q), which often describes a series with fewer parameters than a pure AR or MA would need.

μ=c1−φ,Var(xt)=σ21−φ2,x^T+h=μ+φh(xT−μ);ρMA(1)(1)=θ1+θ2,AIC=2k−2ln⁡L,BIC=kln⁡T−2ln⁡L\mu=\frac{c}{1-\varphi},\quad \mathrm{Var}(x_t)=\frac{\sigma^{2}}{1-\varphi^{2}},\quad \hat x_{T+h}=\mu+\varphi^{h}(x_T-\mu);\qquad \rho_{\mathrm{MA}(1)}(1)=\frac{\theta}{1+\theta^{2}},\qquad \mathrm{AIC}=2k-2\ln L,\quad \mathrm{BIC}=k\ln T-2\ln Lμ=1−φc​,Var(xt​)=1−φ2σ2​,x^T+h​=μ+φh(xT​−μ);ρMA(1)​(1)=1+θ2θ​,AIC=2k−2lnL,BIC=klnT−2lnL(1)

The parameters are estimated by maximum likelihood. The orders are chosen by comparing information criteria, the AIC =2k−2ln⁡L=2k-2\ln L=2k−2lnL and the BIC =kln⁡T−2ln⁡L=k\ln T-2\ln L=klnT−2lnL, where kkk is the number of parameters and LLL the likelihood: lower is better, and the penalty on kkk stops you from adding terms that only fit noise. The BIC penalises more heavily when T>7T>7T>7 and so picks smaller models. After the fit, residuals should look like white noise, which the Ljung-Box test checks. The forecast of a stationary AR(1) returns to the mean geometrically, x^T+h=μ+φh(xT−μ)\hat x_{T+h}=\mu+\varphi^{h}(x_T-\mu)x^T+h​=μ+φh(xT​−μ), and the forecast of an MA(qqq) equals the mean from q+1q+1q+1 steps ahead. Far forecasts of any stationary ARMA are simply the mean, which is why such models are good for the next few steps and no better than the average after that.

An AR(1) forecastLet xt=0.2+0.8 xt−1+εtx_t=0.2+0.8\,x_{t-1}+\varepsilon_txt​=0.2+0.8xt−1​+εt​ with shock standard deviation 0.60.60.6. The mean is μ=0.2/(1−0.8)=1.0\mu=0.2/(1-0.8)=1.0μ=0.2/(1−0.8)=1.0 and the variance is 0.36/(1−0.64)=1.00.36/(1-0.64)=1.00.36/(1−0.64)=1.0. If today's value is xT=2x_T=2xT​=2, the forecast one step ahead is 1+0.8⋅1=1.81+0.8\cdot1=1.81+0.8⋅1=1.8 and two steps ahead 1+0.64⋅1=1.641+0.64\cdot1=1.641+0.64⋅1=1.64. The gap to the mean shrinks by the factor 0.80.80.8 each step, and after ten steps the forecast is 1.111.111.11, almost the mean.
  • AR(ppp) depends on its own past values; MA(qqq) on the last qqq shocks; ARMA on both.
  • AIC and BIC reward fit and punish parameters; the model with the lowest value wins, the BIC being stricter.
  • Forecasts of a stationary ARMA converge to the mean as the horizon grows.

Lab · what's graded

  • The mean of an AR(1)15 pts
  • A two-step forecast15 pts
  • An MA(1) autocorrelation15 pts
  • An information criterion15 pts
  • A non-stationary coefficient15 pts
  • Match the vocabulary15 pts
  • Why far forecasts reach the mean10 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

For xt=0.2+0.8 xt−1+εtx_t=0.2+0.8\,x_{t-1}+\varepsilon_txt​=0.2+0.8xt−1​+εt​, what is the long-run mean μ=c/(1−φ)\mu=c/(1-\varphi)μ=c/(1−φ)?

mu=mu =mu=accepted: ± 0.01
2Numeric answer15 ptsNot answered

The same model has μ=1\mu=1μ=1 and today's value is xT=2x_T=2xT​=2. What is the two-step forecast μ+φ2(xT−μ)\mu+\varphi^{2}(x_T-\mu)μ+φ2(xT​−μ)?

f2=f2 =f2=accepted: ± 0.01
3Numeric answer15 ptsNot answered

For an MA(1) with θ=0.5\theta=0.5θ=0.5, what is the lag-one autocorrelation θ/(1+θ2)\theta/(1+\theta^{2})θ/(1+θ2)?

rho=rho =rho=accepted: ± 0.005
4Numeric answer15 ptsNot answered

An ARMA model has k=3k=3k=3 parameters and a maximised log-likelihood ln⁡L=−120\ln L=-120lnL=−120. What is its AIC =2k−2ln⁡L=2k-2\ln L=2k−2lnL?

aic=aic =aic=accepted: ± 0.5
5Choice15 ptsNot answered

Which AR(1) coefficient φ\varphiφ gives a series that is not stationary?

6Match15 ptsNot answered

Match each term with its meaning.

Pick the partner of each item on the left.

AR model
MA model
AIC
BIC
7Explain in words10 ptsNot answered

In one or two sentences, explain why the forecast of a stationary AR(1) approaches the mean as the horizon grows.

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