# forecast

Forecast univariate autoregressive integrated moving average (ARIMA) model responses or conditional variances

## Syntax

## Description

`[`

returns `Y`

,`YMSE`

]
= forecast(`Mdl`

,`numperiods`

,`Y0`

)`numperiods`

consecutive forecasted responses `Y`

and corresponding mean square errors (MSE) `YMSE`

of the fully specified, univariate ARIMA model `Mdl`

. The presample response data `Y0`

initializes the model to generate forecasts.

`[`

uses additional options specified by one or more name-value arguments. For example, for a model with a regression component (that is, an ARIMAX model), `Y`

,`YMSE`

] = forecast(`Mdl`

,`numperiods`

,`Y0`

,`Name,Value`

)`'X0',X0,'XF',XF`

specifies the presample and forecasted predictor data `X0`

and `XF`

, respectively.

## Examples

## Input Arguments

## Output Arguments

## More About

## Algorithms

The

`forecast`

function sets the number of sample paths (`numpaths`

) to the maximum number of columns among the presample data sets`E0`

,`V0`

, and`Y0`

. All presample data sets must have either one column or`numpaths`

> 1 columns. Otherwise,`forecast`

issues an error. For example, if you supply`Y0`

and`E0`

, and`Y0`

has five columns representing five paths, then`E0`

can each have one column or five columns. If`E0`

has one column,`forecast`

applies`E0`

to each path.`NaN`

values in presample and future data sets indicate missing data.`forecast`

removes missing data from the presample data sets following this procedure:`forecast`

horizontally concatenates the specified presample data sets`Y0`

,`E0`

,`V0`

, and`X0`

so that the latest observations occur simultaneously. The result can be a jagged array because the presample data sets can have a different number of rows. In this case,`forecast`

prepads variables with an appropriate number of zeros to form a matrix.`forecast`

applies list-wise deletion to the combined presample matrix by removing all rows containing at least one`NaN`

.`forecast`

extracts the processed presample data sets from the result of step 2, and removes all prepadded zeros.

`forecast`

applies a similar procedure to the forecasted predictor data`XF`

. After`forecast`

applies list-wise deletion to`XF`

, the result must have at least`numperiods`

rows. Otherwise,`forecast`

issues an error.List-wise deletion reduces the sample size and can create irregular time series.

When

`forecast`

estimates the MSEs`YMSE`

of the conditional mean forecasts`Y`

, the function treats the specified predictor data sets`X0`

and`XF`

as exogenous, nonstochastic, and statistically independent of the model innovations. Therefore,`YMSE`

reflects only the variance associated with the ARIMA component of the input model`Mdl`

.

## References

[1] Baillie, Richard T., and Tim Bollerslev. “Prediction in Dynamic Models with Time-Dependent Conditional Variances.” *Journal of Econometrics* 52, (April 1992): 91–113. https://doi.org/10.1016/0304-4076(92)90066-Z.

[2] Bollerslev, Tim. “Generalized Autoregressive Conditional Heteroskedasticity.” *Journal of Econometrics* 31 (April 1986): 307–27. https://doi.org/10.1016/0304-4076(86)90063-1.

[3] Bollerslev, Tim. “A Conditionally Heteroskedastic Time Series Model for Speculative Prices and Rates of Return.” *The Review of Economics and Statistics* 69 (August 1987): 542–47. https://doi.org/10.2307/1925546.

[4] Box, George E. P., Gwilym M. Jenkins, and Gregory C. Reinsel. *Time Series Analysis: Forecasting and Control*. 3rd ed. Englewood Cliffs, NJ: Prentice Hall, 1994.

[5] Enders, Walter. *Applied Econometric Time Series*. Hoboken, NJ: John Wiley & Sons, Inc., 1995.

[6] Engle, Robert. F. “Autoregressive Conditional Heteroscedasticity with Estimates of the Variance of United Kingdom Inflation.” *Econometrica* 50 (July 1982): 987–1007. https://doi.org/10.2307/1912773.

[7] Hamilton, James D. *Time Series Analysis*. Princeton, NJ: Princeton University Press, 1994.

## Version History

**Introduced in R2012a**