I want to generate stochastic forecasts/simulations for (1) an AR model and (2) a VAR model, as follows:
(a) recursive static stochastic 1-step ahead forecasts via bootstrapping residuals and adding them to the static forecast.
(b) dynamic stochastic multiperiods-periods ahead forecasts via bootstrapping residuals and adding the residual initially to the static 1-step ahead forecast, and thereafter to the stochastic forecasts - as they are iterated.
The average of the RHS across EACH of the simulations being treated as the stochastic forecast.
The idea catering for the fact that a normal distribution for the forecast errors maybe an unreasonable assumption, further assumes future residuals are similar to past residuals, and related to https://otexts.com/fpp3/prediction-intervals.html.
static stochastic 1-step ahead
stoch_fcast(t+1) = static_fcast_one-step(t+1) + unknown_future_residual(t+1)
The unknown_future_residual(t+1) is bootstrap (10000 draws) sampled from the model "fitted" residuals and averaged.
and repeating,
stoch_fcast(t+2) = static_fcast_one-step(t+2) + unknown_future_residual(t+2)
where unknown_future_residual(t+2) is another bootstrap (10000 draws) sampled from the collection of residuals and averaged.
etc etc.
dynamic stochastic multiperiods-periods ahead
stoch_fcast(t+1) = static_fcast_one-step(t+1) + unknown_future_residual(t+1)
stoch_fcast(t+2) = stoch_fcast(t+1) + unknown_future_residual(t+2)
stoch_fcast(t+3) = stoch_fcast(t+2) + unknown_future_residual(t+3)
etc etc.
Here's an incorrect attempt at recursive static stochastic 1-step ahead forecasts for an AR model. I am unclear as to the RATS commands/syntax for the bootstrap?
Code: Select all
seed 13939
do regend = ibegin, iend
boxjenk(constant,ar=1,define=eqmodel) y istart regend resids
uforecast(equation=eqmodel,from=regend+1,steps=1) yhat_S_model
do i = 1, 10000
boot resids
set ac_sample = resids(t)
set stoch_fcasts = yhat_S_model + ac_sample
end do i
sstats(mean) stoch_fcasts>>stoch_fcasts_mean
end do regend
prin / stoch_fcasts_mean
Amarjit