AR Forecasting
Forecasting workflow for autoregressive models: estimate parameters from data, then compute the best linear predictor and prediction intervals.
1. Parameter Estimation from Data
Given observations $\{x_t\}_{t=1}^n$ from an AR(1) model $X_t = \phi_1 X_{t-1} + Z_t$:
- Compute sample ACVF: $\hat{\gamma}_X(0)$ and $\hat{\gamma}_X(1)$
- Estimate $\hat{\phi}_1 = \hat{\gamma}_X(1) / \hat{\gamma}_X(0)$
- Estimate $\hat{\sigma}^2 = \hat{\gamma}_X(0)(1 - \hat{\phi}_1^2)$
Alternatively, fit via lm() regression of $(x_2, \dots, x_n)$ on $(x_1, \dots, x_{n-1})$ without intercept.
2. One-Step Forecast
$$P_n X_{n+1} = \hat{\phi}_1 x_n$$$$\text{MSE} = \hat{\sigma}^2$$3. Prediction Interval
95% prediction interval:
$$P_n X_{n+1} \pm 1.96 \hat{\sigma}$$4. Comparing Methods
When comparing the best linear predictor $P_n X_{n+1}$ (hand-computed from ACVF) with a software-based forecast (e.g., itsmr::forecast()), the results should be close but may differ slightly due to:
- Different estimation methods
- Classical decomposition accounting for trend/seasonality
- Different assumed model structure