------------------------------------------------------------------------------- help fordpredictjuraj.katriak@iskwien.at -------------------------------------------------------------------------------

Titledpredict-- Dynamic forecasting for ARIMA(p,d,q) models

Syntax

dpredict[varlist],from(#)to(#)periods(#)[lvl]:command

optionsDescription -------------------------------------------------------------------------from(#)the number of the last observation of the first subsampleto(#)the number of the last observation of the last subsampleperiods(#)horizon (no. of periods) of the dynamic forecastslvlspecifies that the dependent variable of the arima-command is in levels, rather than in differencesnorecursivespecifies that the subsamples will have a fixed size, rather than grow -------------------------------------------------------------------------commandmust be a valid arima estimation command

Description

dpredictcalculates dynamic predictions from thecommand, which must be thearimacommand. The predictions calculated bydpredictare all out-of-sample predictions, each based on a different subsample. The horizon of the predictions (how many periods ahead) is specified by theperiods(#)option. The subsamples, which the predictions are based on, change sequentially starting with the subsample delimited by 1/from(#)up to 1/to(#). If thenorecursiveoption is specified, then the subsamples will have a fixed size offrom(#)observations, i.e. the first subsample will be 1/from(#)and the last (to(#)-from(#))/to(#).If the

lvloptions is not specified, then the direction-of-change statistic is computed assuming that the dependent variable of the supplied arima-commmand is in differences corresponding to the forecast horizon specified inperiods(#)(i.e. if the forecast horizon is e.g. 3 then the it is assumed that the dependent variable is of the form of s3.dep_var).If

varlistis supplied then in each step the last observation in the current subsample of the all variables in specified in arima (including the dependent) is replaced by the corresponding observation fromvarlist. Hence, ifvarlistis supplied, it must contain the same number of variables as the arima command. This allows for the possibility that the last observation of some variables in the dataset must, in fact, be predicted, because it is not available at the time when making the forecasts.

Saved Results

dpredictsaves in r(): scalars , r(RMSE), r(MAE) and r(DOC), containing the computed statistcs RMSE, MAE, DOC and matrices , r(Yhat) and r(ResMat), which contain the out-of-sample predictions and residuals respectively. Additionaly a matrix , r(DOCmat), with elements 1 (if the direction of change was predicted correctly) and 0 (if not) is saved.

RemarksThe statistisc computed along with the predictions are: RMSE - root mean square error, MAE - mean absolute errror and DOE - direction of change (gives the proportion of correctly predicted values of

dep_var)

Examples

. use http://www.stata-press.com/data/r9/wpi1

. gen wpi_df = d.wpi

. dpredict , f(80) t(124) p(1) : arima wpi_df , arima(1,0,1)

AuthorJ. Katriak, ISK Vienna, juraj.katriak@iskwien.at

Also seeOnline: help for arima, arima_postestimation