**[TS] arima postestimation** -- Postestimation tools for arima

__Postestimation commands__

The following postestimation commands are of special interest after
**arima**:

Command Description
-------------------------------------------------------------------------
**estat acplot** estimate autocorrelations and autocovariances
**estat aroots** check stability condition of estimates
**irf** create and analyze IRFs
**psdensity** estimate the spectral density
-------------------------------------------------------------------------

The following standard postestimation commands are also available:

Command Description
-------------------------------------------------------------------------
**estat ic** Akaike's and Schwarz's Bayesian information criteria
(AIC and BIC)
**estat summarize** summary statistics for the estimation sample
**estat vce** variance-covariance matrix of the estimators (VCE)
**estimates** cataloging estimation results
**forecast** dynamic forecasts and simulations
**lincom** point estimates, standard errors, testing, and
inference for linear combinations of coefficients
**lrtest** likelihood-ratio test
**margins** marginal means, predictive margins, marginal effects,
and average marginal effects
**marginsplot** graph the results from margins (profile plots,
interaction plots, etc.)
**nlcom** point estimates, standard errors, testing, and
inference for nonlinear combinations of coefficients
**predict** predictions, residuals, influence statistics, and
other diagnostic measures
**predictnl** point estimates, standard errors, testing, and
inference for generalized predictions
**test** Wald tests of simple and composite linear hypotheses
**testnl** Wald tests of nonlinear hypotheses
-------------------------------------------------------------------------

__Syntax for predict__

**predict** [*type*] *newvar* [*if*] [*in*] [**,** *statistic* *options*]

*statistic* Description
-------------------------------------------------------------------------
Main
**xb** predicted values for mean equation -- the differenced
series; the default
**stdp** standard error of the linear prediction
**y** predicted values for the mean equation in *y* -- the
undifferenced series
**mse** mean squared error of the predicted values
__r__**esiduals** residuals or predicted innovations
__yr__**esiduals** residuals or predicted innovations in y, reversing any
time-series operators
-------------------------------------------------------------------------
These statistics are available both in and out of sample; type **predict**
*...* **if e(sample)** *...* if wanted only for the estimation sample.
Predictions are not available for conditional ARIMA models fit to panel
data.

*options* Description
-------------------------------------------------------------------------
Options
__d__**ynamic(***time_constant***)** how to handle lags of y_t
**t0(***time_constant***)** set starting point for the recursions to
*time_constant*
__str__**uctural** calculate considering the structural
component only
-------------------------------------------------------------------------
*time_constant* is a *#* or a time literal, such as **td(1jan1995)** or
**tq(1995q1)**; see *Conveniently typing SIF values* in **[D] datetime**.

__Menu for predict__

**Statistics > Postestimation**

__Description for predict__

**predict** creates a new variable containing predictions such as expected
values and mean squared errors. All predictions are available as static
one-step-ahead predictions or as dynamic multistep predictions, and you
can control when dynamic predictions begin.

__Options for predict__

+------+
----+ Main +-------------------------------------------------------------

**xb**, the default, calculates the predictions from the model. If **D.***depvar*
is the dependent variable, these predictions are of **D.***depvar* and not
of *depvar* itself.

**stdp** calculates the standard error of the linear prediction **xb**. **stdp**
does not include the variation arising from the disturbance equation;
use **mse** to calculate standard errors and confidence bands around the
predicted values.

**y** specifies that predictions of *depvar* be made, even if the model was
specified in terms of, say, **D.***depvar*.

**mse** calculates the MSE of the predictions.

**residuals** calculates the residuals. If no other options are specified,
these are the predicted innovations; that is, they include the ARMA
component. If **structural** is specified, these are the residuals from
the structural equation; see **structural** below.

**yresiduals** calculates the residuals in terms of *depvar*, even if the model
was specified in terms of, say, **D.***depvar*. As with **residuals**, the
**yresiduals** are computed from the model, including any ARMA component.
If **structural** is specified, any ARMA component is ignored, and
**yresiduals** are the residuals from the structural equation; see
**structural** below.

+---------+
----+ Options +----------------------------------------------------------

**dynamic(***time_constant***)** specifies how lags of y_t in the model are to be
handled. If **dynamic()** is not specified, actual values are used
everywhere that lagged values of y_t appear in the model to produce
one-step-ahead forecasts.

**dynamic(***time_constant***)** produces dynamic (also known as recursive)
forecasts. *time_constant* specifies when the forecast is to switch
from one step ahead to dynamic. In dynamic forecasts, references to
y_t evaluate to the prediction of y_t for all periods at or after
*time_constant*; they evaluate to the actual value of y_t for all prior
periods.

For example, **dynamic(10)** would calculate predictions in which any
reference to y_t with t < 10 evaluates to the actual value of y_t and
any reference of y_t with t__>__10 evaluates to the prediction of y_t.
This means that one-step-ahead predictions are calculated for t < 10
and dynamic predictions thereafter. Depending on the lag structure
of the model, the dynamic predictions might still refer to some
actual values of y_t.

You may also specify **dynamic(.)** to have **predict** automatically switch
from one-step-ahead to dynamic predictions at p + q, where p is the
maximum AR lag and q is the maximum MA lag.

**t0(***time_constant***)** specifies the starting point for the recursions to
compute the predicted statistics; disturbances are assumed to be 0
for t < **t0()**. The default is to set **t0()** to the minimum t observed
in the estimation sample, meaning that observations before that are
assumed to have disturbances of 0.

**t0()** is irrelevant if **structural** is specified because then all
observations are assumed to have disturbances of 0.

**t0(5)** would begin recursions at t=5. If the data were quarterly, you
might instead type **t0(tq(1961q2))** to obtain the same result.

The ARMA component of ARIMA models is recursive and depends on the
starting point of the predictions. This includes one-step-ahead
predictions.

**structural** specifies that the calculation be made considering the
structural component only, ignoring the ARMA terms, producing the
steady-state equilibrium predictions.

__Syntax for margins__

**margins** [*marginlist*] [**,** *options*]

**margins** [*marginlist*] **,** __pr__**edict(***statistic *...**)** [__pr__**edict(***statistic *...**)**
...] [*options*]

*statistic* Description
-------------------------------------------------------------------------
**xb** predicted values for mean equation -- the differenced
series; the default
**y** predicted values for the mean equation in *y* -- the
undifferenced series
**stdp** not allowed with **margins**
**mse** not allowed with **margins**
__r__**esiduals** not allowed with **margins**
__yr__**esiduals** not allowed with **margins**
-------------------------------------------------------------------------

Statistics not allowed with **margins** are functions of stochastic
quantities other than **e(b)**.

For the full syntax, see **[R] margins**.

__Menu for margins__

**Statistics > Postestimation**

__Description for margins__

**margins** estimates margins of response for expected values.

__Examples__

Setup
**. webuse wpi1**

Fit ARIMA model with additive seasonal effects
**. arima D.ln_wpi, ar(1) ma(1 4)**

Compute predictions for **D.ln_wpi**
**. predict xb**

Consider structural component only -- ignore ARMA terms -- when making
predictions
**. predict xbs, structural**

Compute predictions for **ln_wpi**, reversing any time-series operators
applied in estimation
**. predict y, y**

Compute predictions for **ln_wpi**, using lagged forecasted values for
predictions after 1970q1 instead of lagged actual values
**. predict yd, y dynamic(tq(1970q1))**

Graph time-series line plot
**. tsline y yd**