Forecasting ARMA Models INSR 260, Spring 2009 Bob Stine 1 Over view Review Model selection criteria Residual diagnostics Prediction Normality Stationary vs non-stationary models Calculations Case study 2 Review Autoregressive, moving average models AR(p) Y = δ + φ Y + φ Y + … + φ Y + a t 1 t-1 2 t-2 p t-p t MA(q) Y = μ + a - θ a - θ a -... - θ a Watch negative signs t t 1 t-1 2 t-2 q t-q!! ! ARMA(p,q) Y = δ + φ Y + φ Y + a - θ a ! ! ! ARMA(2,1) t 1 t-1 2 t-2 t 1 t-1 Common feature Every stationary ARMA model specifies Yt as a weighted sum of past error terms !Y = a + w a + w a + w a +… t t 1 t-1 2 t-2 3 t-3 e.g., AR(1) sets w = φj j ARMA models for non-stationary data Differencing produces a stationary series. These differences are a weighted average of prior errors. 3 Modeling Process Initial steps Before you work with data: think about context!! ! What do you expect to find in a model? What do you need to get from a model? ARIMA = short-term forecasts Set a baseline: What results have been obtained by other models? Plot time series Inspect SAC, SPAC Estimation Fit initial model, explore simpler & more complex models Check residuals for problems Ljung-Box test of residual autocorrelations Residual plots show outliers, other anomalies Forecasting Check for normality Extrapolate pattern implied by dependence Compare to baseline estimates 4 Forecasting ARMA Characteristics Forecasts from stationary models revert to mean Integrated models revert to trend (usually a line) Accuracy deteriorates as extrapolate farther Variance of prediction error grows Prediction intervals at fixed coverage (e.g. 95%) get wider Calculations Fill in unknown values with predictions Pretend estimated model is the true model Example: ARMA (2,1) ! Y = δ + φ Y + φ Y + a - θ a t 1 t-1 2 t-2 t 1 t-1 One-step ahead:!Ŷ = δ + φ Y + φ Y + (â =0) - θ â n+1 1 n 2 n-1 n+1 1 n Two! ! ! ! ! Ŷ = δ + φ Ŷ + φ Y + (â =0) - θ (â =0) n+2 1 n+1 2 n n+2 1 n+1 Three!! ! ! ! Ŷ = δ + φ Ŷ + φ Ŷ + 0 + 0 n+3 1 n+2 2 n+1 AR gradually damp out, MA terms disappear (as in autocorrelations) 5 Accuracy of Forecasts Assume Estimated model is true model Key fact ARMA models represent Y as weighted sum of past errors t Theory: Forecasts omit unknown error terms Y = μ + a + w a + w a + w a +… n+1 n+1 1 n 2 n-1 3 n-2 “known” Ŷ = μ + w a + w a + … n+1 1 n 2 n-1 (cid:15482) ! ! ! ! ! ! ! ! ! ! !Y - Ŷ = a n+1 n+1 n+1 Y = μ + a + w a + w a + w a +… n+2 n+2 1 n+1 2 n 3 n-1 Ŷ = μ + w a + w a +… n+2 2 n 3 n-1 (cid:15482) ! ! ! ! ! ! ! ! ! ! !Y - Ŷ = a + w a n+2 n+2 n+2 1 n+1 Variance of forecast error grows as (a are iid) t ! ! ! ! σ2(1 + w 2 + w 2 + …) 1 2 6 Example: ARMA(1,1) Simulated data Know that we’re fitting the right model Compare forecasts to actual future values δ is not the mean of the Estimated model series Parameter Estimates δ Constant Term Estimate Estimate AR1 0.7467 0.07988923 MA1 -0.7954 intercept = mean Intercept 0.3154 Reverse sign on Forecasts moving average estimates n=200 ŷ =0.080+0.75(1.22)+0.80(-0.29) 201 ŷ =0.080+0.75(0.76)+0.80(0) 202 ŷ =0.080+0.75(0.65) 203 ŷ = δ + φy - θa n+f n+f-1 n+f-1 SD(y) = 2.50 7 0.315 Forecasts Forecasts revert quickly to series mean Unless model is non-stationary or has very strong autocorrelations Prediction intervals open as extrapolate Variance of prediction errors rapidly approaches series variance 10.00 5.00 Y 0.00 -5.00 observed forecast -10.00 196 198 200 202 204 206 208 210 Rows 8 Detailed Calculations MA(2)!! ! Y = μ + a - θ a - θ a t t 1 t-1 2 t-2 Forecasting 1-step!! ! ! ! ! Y = μ + a - θ a - θ a n+1 n+1 1 n 2 n-1 Ŷ = μ - θ a - θ a ! ! ! ! ! ! ! n+1 1 n 2 n-1 Y - Ŷ = a n+1 n+1 n+1 Var(Y - Ŷ ) = σ2 n+1 n+1 2-steps! ! ! ! ! Y = μ + a - θ a - θ a n+2 n+2 1 n+1 2 n Ŷ = μ - θ a ! ! ! ! ! ! ! n+2 2 n Y - Ŷ = a - θ a n+2 n+2 n+2 1 n+1 Var(Y - Ŷ ) = σ2(1+θ 2) n+2 n+2 1 3-steps! ! ! ! ! Y = μ + a - θ a - θ a n+3 n+3 1 n+2 2 n+1 Ŷ = μ ! ! ! ! ! ! ! n+3 Y - Ŷ = a + θ a + θ a n+3 n+3 n+3 1 n+2 2 n+1 Var(Y - Ŷ ) = σ2(1+θ 2+θ 2) n+3 n+3 1 2 9 Example: MA(2) w/Numbers Predictions Ŷ = μ - θ a - θ a n+1 1 n 2 n-1 Model Summary = 0.162 + 0.996(-.0464) + 0.380(.144) DF 177.0000 Stable Yes ! Sum of Squared Errors 188.3783 Invertible Yes != 0.1705 Variance Estimate 1.0643 Standard Deviation 1.0316 Akaike's 'A' Information Criterion 526.0554 Ŷ = μ - θ â - θ a n+2 1 n+1 2 n Parameter Estimates = 0.162 + 0.996(0) + 0.380(-.0464) Constant ! Term Lag Estimate Std Error t Ratio Prob>|t| Estimate != 0.1443 MA1 1 -0.9962 0.0647622 -15.38 <.0001* 0.16199858 MA2 2 -0.3803 0.0590225 -6.44 <.0001* Intercept 0 0.1620 0.1802599 0.90 0.3700 Ŷ = μ - θ â - θ â n+3 1 n+2 2 n+1 = 0.046 + 0.996(0) + 0.380(0) ! != 0.162 SD of prediction error 1-step: σ = 1.0316 2-steps σ sqrt(1 + θ 2) = 1.0316(1+.9962)1/2 1 ! ! ! ! ! = 1.456 3-steps σ sqrt(1+θ 2+θ 2) = 1.0316(1+.9962+.3802)1/2 1 2 ! ! ! ! ! = 1.508 10
Description: