V = forecast(Mdl,numperiods,Y0,Name,Value)
generates forecasts with additional options specified by one or more name-value pair
arguments. For example, you can initialize the model by specifying presample
conditional variances.

Forecasts made without using presample innovations equal the unconditional innovation variance. Forecasts made using presample innovations converge asymptotically to the unconditional innovation variance.

Forecasts made without using presample innovations equal the unconditional innovation variance. Forecasts made using presample innovations converge asymptotically to the unconditional innovation variance.

Forecasts made without using presample innovations equal the unconditional innovation variance. Forecasts made using presample innovations converge asymptotically to the unconditional innovation variance.

Input Arguments

Conditional variance model without any unknown parameters, specified
as a garch, egarch, or gjr model
object.

Mdl cannot contain any properties that have NaN value.

numperiods — Forecast horizonpositive integer

Forecast horizon, or the number of time points in the forecast period, specified as a
positive integer.

Data Types: double

Y0 — Presample response datanumeric column vector | numeric matrix

Presample response data used to infer presample innovations E0, and whose conditional
variance is forecasted, specified as a numeric column vector with length
numpreobs or a
numpreobs-by-numpaths numeric
matrix.

Y0 can represent a mean 0 presample innovations series
with a variance process characterized by the conditional variance model
Mdl. Y0 can also represent a
presample innovations series plus an offset (stored in
Mdl.Offset). For more details, see Algorithms.

Rows of Y0 correspond to periods in the presample, and
the last row contains the latest presample response.
numpreobs is the number of specified presample
responses and it must be at least Mdl.Q to initialize the
variance equation. If numpreobs exceeds
Mdl.Q, forecast uses only the
latest Mdl.Q rows. For more details, see Time Base Partitions for Forecasting.

Columns of Y0 correspond to separate, independent
paths.

If Y0 is a column vector,
forecast applies it to each forecasted
path. In this case, all forecast paths Y derive
from the same initial responses.

If Y0 is a matrix, it must have
numpaths columns, where
numpaths is the maximum among the second
dimensions of the specified presample observation arrays
Y0 and V0.

Data Types: double

Name-Value Pair Arguments

Specify optional
comma-separated pairs of Name,Value arguments. Name is
the argument name and Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN.

Presample conditional variances used to initialize the conditional
variance model, specified as the comma-separated pair consisting of
'V0' and a numeric column vector or matrix with
positive entries and numpaths columns.

Rows of V0 correspond to periods in the presample,
and the last row contains the latest presample conditional variance.

For GARCH(P,Q) and
GJR(P,Q) models,
V0 must have at least
Mdl.P rows to initialize the variance
equation.

For EGARCH(P,Q)
models, V0 must have at least
max([Mdl.P Mdl.Q]) rows to initialize
the variance equation.

If the number of rows exceeds the minimum number, then
forecast uses the latest observations
only.

Columns of V0 correspond to separate, independent paths.

If V0 is a column vector,
forecast applies it to each
forecasted path. In this case, the conditional variance
model of all forecast paths Y derives
from the same initial conditional variances.

If V0 is a matrix, it must have
numpaths columns.

By default, if Y0 has at least
max(P,Q) +
P rows, forecast
infers any necessary presample conditional variances by
passing Mdl and Y0
to infer.

By default, if Y0 has insufficient length:

For
GARCH(P,Q)
and GJR(P,Q)
models, forecast sets any
necessary presample conditional variances to the
unconditional variance of the conditional variance
process.

For
EGARCH(P,Q)
models, forecast sets any
necessary presample conditional variances to the
exponentiated, unconditional mean of the logarithm
of the
EGARCH(P,Q)
variance process.

Data Types: double

Note

forecast assumes that you synchronize presample data
such that the latest observation of each presample series occurs
simultaneously.

Output Arguments

Minimum mean square error (MMSE) forecasts of conditional variances of
future model innovations, returned as a numeric column vector with length
numperiods or a
numperiods-by-numpaths numeric
matrix. V represents a continuation of
V0 (V(1,:) occurs in the next
time point after V0(end,:)).

More About

Time Base Partitions for Forecasting

Time base partitions for forecasting are
two disjoint, contiguous intervals of the time base; each interval contains time
series data for forecasting a dynamic model. The forecast
period (forecast horizon) is a numperiods
length partition at the end of the time base during which
forecast generates forecasts V from
the dynamic model Mdl. The presample
period is the entire partition occurring before the forecast period.
forecast can require observed responses (or innovations)
Y0 or conditional variances V0 in the
presample period to initialize the dynamic model for forecasting. The model
structure determines the types and amounts of required presample
observations.

A common practice is to fit a dynamic model to a portion of the data set, then
validate the predictability of the model by comparing its forecasts to observed
responses. During forecasting, the presample period contains the data to which the
model is fit, and the forecast period contains the holdout sample for validation.
Suppose that yt is an observed response
series. Consider forecasting conditional variances from a dynamic model of
ytnumperiods = K periods. Suppose that the
dynamic model is fit to the data in the interval [1,T –
K] (for more details, see estimate). This figure shows the time base partitions for
forecasting.

For example, to generate forecasts Y from a GARCH(0,2) model,
forecast requires presample responses (innovations)
Y0 = [yT−K−1yT−K]′ to initialize the model. The 1-period-ahead forecast requires both
observations, whereas the 2-periods-ahead forecast requires
yT –
K and the 1-period-ahead forecast
V(1). forecast generates all other
forecasts by substituting previous forecasts for lagged responses in the
model.

Algorithms

If the conditional variance model Mdl has an offset
(Mdl.Offset), forecast subtracts
it from the specified presample responses Y0 to obtain
presample innovations E0. Subsequently,
forecast uses E0 to initialize
the conditional variance model for forecasting.

forecast sets the number of sample paths to forecast
numpaths to the maximum number of columns among the
presample data sets Y0 and V0. All
presample data sets must have either numpaths > 1 columns or
one column. Otherwise, forecast issues an error. For
example, if Y0 has five columns, representing five paths,
then V0 can either have five columns or one column. If
V0 has one column, then forecast
applies V0 to each path.

forecast horizontally concatenates the
specified presample data sets Y0 and
V0 such 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 amount 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.

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

Compatibility Considerations

forecast now has a third input argument for you to supply
presample response data.

forecast(Mdl,numperiods,Y0)
forecast(Mdl,numperiods,Y0,Name,Value)

Before R2019a, the syntaxes
were:

forecast(Mdl,numperiods)
forecast(Mdl,numperiods,Name,Value)

You
could optionally supply presample responses using the 'Y0'
name-value pair argument.

There are no plans to remove the previous syntaxes or the 'Y0'
name-value pair argument at this time. However, you are encouraged to supply
presample responses because, to forecast conditional variances from a conditional
variance model, forecast must initialize models containing
lagged variables. Without specified presample responses,
forecast initializes models by using reasonable default
values, but the default might not support all workflows. This table describes the
default values for each conditional variance model object.

Model Object

Presample Default

garch

All presample responses are the unconditional standard
deviation of the process.

egarch

All presample responses are 0.

gjr

All presample responses are the unconditional standard
deviation of the process.

Update Code

Update your code by specifying presample response data in the third input
argument.

If you do not supply presample responses, then forecast
provides default presample values that might not support all workflows.

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.