forecast

Class: gjr

Forecast GJR process

Syntax

V = forecast(Mdl,numPeriods)
V = forecast(Mdl,numPeriods,Name,Value)

Description

V = forecast(Mdl,numPeriods) forecasts the conditional variance of a GJR process over a specified forecast horizon.

V = forecast(Mdl,numPeriods,Name,Value) generates forecasts with additional options specified by one or more Name,Value pair arguments.

Input Arguments

expand all

Mdl — GJR modelgjr model

GJR model, specified as a gjr model returned by gjr or estimate.

The properties of Mdl cannot contain NaNs.

numPeriods — Forecast horizonpositive integer

Forecast horizon, specified as a positive integer.

The periods in the forecast horizon must be consistent with the periodicity of Mdl and the presample data.

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 single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Y0' — Presample responsesnumeric column vector | numeric matrix

Presample responses whose conditional variance is forecasted, specified as the comma-separated pair consisting of 'Y0' and a numeric column vector or numeric matrix.

Y0 must have at least Mdl.Q rows to initialize the variance equation. If the number of rows exceeds Mdl.Q, then the software uses the latest Mdl.Q observations to derive presample innovations (denoted E0 in other methods). The last row contains the latest observation.

If Y0 is a column vector, it represents a single path of the underlying innovation series. If Y0 is a matrix, then it requires numPaths columns, each representing a presample path of the underlying innovation series.

Y0 usually represents a time series of presample innovations with mean 0 and variance characterized by the model specified in Mdl. Y0 might also represent a time series of innovations with mean 0 plus an offset. If Mdl has a nonzero offset, then the software stores its value in the Offset property (Mdl.Offset).

If you specify Y0, then the software derives any necessary presample innovations (E0) from Y0 by subtracting any offset. The software uses these presample innovations as initial values for the GJR(P,Q) model forecast.

By default, the software sets necessary presample innovations to the unconditional standard deviation of the GJR process.

Data Types: double

'V0' — Presample conditional variancesnumeric column vector with positive entries | numeric matrix with positive entries

Presample conditional variances providing initial values for the GJR(P,Q) model, specified as the comma-separated pair consisting of 'V0' and a numeric column vector or matrix with positive entries.

V0 must have at leastMdl.P rows to initialize the variance equation. If the number of rows exceeds the number necessary, only the latest Mdl.P observations are used. The last row contains the latest observation.

If V0 is a column vector, it represents a single presample path of the variance series. If V0 is a matrix, then it requires numPaths columns, each representing a presample path of the variance series.

By default, if Y0 has at least max(P,Q) + P observations, then the software infers necessary presample observations from the corresponding presample response data in Y0. If you do not specify Y0 or it has insufficient length, then the software sets the presample conditional variances to the unconditional variance of the GJR process.

Data Types: double

    Notes:  

    • The number of sample paths, numPaths, is the largest column dimension of the presample arrays Y0 and V0, but not fewer than one.

    • If both Y0 and V0 are matrices with multiple columns, they must both have numPaths columns. Otherwise, an error occurs.

    • NaNs indicate missing values. The toolbox uses list-wise deletion to remove missing values in the presample data, Y0 and V0. That is, Y0 and V0 are merged into a composite series, and any row of the combined series with at least one NaN is removed.

    • forecast assumes you synchronize presample data such that the last (most recent) observation of each presample series occurs simultaneously.

Output Arguments

expand all

V — Minimum mean square error forecasts of conditional variances of future model innovationsnumeric matrix

Minimum mean square error forecasts of conditional variances of future model innovations, returned as a numeric matrix. V has numPeriods rows and numPaths columns.

The software infers numPaths from the presample information specified by the name-value pair arguments Y0 and V0. If you do not specify Y0 and V0, then V is a numPeriods column vector.

The first row of V contains the conditional variance forecasts in period 1, the second row contains the conditional variance forecasts in period 2, and so on until the last row, which contains the conditional variance forecasts at the forecast horizon specified by the input argument numPeriods.

Data Types: double

Examples

expand all

Forecast Conditional Variances

Forecast the conditional variance of simulated data over a 30-period horizon.

Simulate 100 observations from a GJR(1,1) model with known parameters.

Mdl = gjr('Constant',0.01,'GARCH',0.6,'ARCH',0.2,...
    'Leverage',0.2);
rng default; % For reproducibility
[v,y] = simulate(Mdl,100);

Forecast the conditional variances over a 30-period horizon, with and without using the simulated data as presample innovations. Plot the forecasts.

vF1 = forecast(Mdl,30,'Y0',y);
vF2 = forecast(Mdl,30);

figure
plot(v,'Color',[.7,.7,.7])
hold on
plot(101:130,vF1,'r','LineWidth',2);
plot(101:130,vF2,':','LineWidth',2);
title('Forecasted Conditional Variances')
legend('Observed','Forecasts with Presamples',...
		'Forecasts without Presamples','Location','NorthEast')
hold off

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

Forecast the Conditional Variance of NASDAQ Returns

Forecast the conditional variance of the NASDAQ Composite Index returns over a 500-day horizon.

Load the NASDAQ data included with the toolbox. Convert the index to returns.

load Data_EquityIdx
nasdaq = DataTable.NASDAQ;
r = price2ret(nasdaq);
T = length(r);

Fit a GJR(1,1) model to the data.

Mdl = gjr(1,1);
EstMdl = estimate(Mdl,r);
 
    GJR(1,1) Conditional Variance Model:
    --------------------------------------
    Conditional Probability Distribution: Gaussian

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant     2.4567e-06   5.68278e-07        4.32306
     GARCH{1}       0.881439    0.00947789        92.9995
      ARCH{1}      0.0639389    0.00917694        6.96734
  Leverage{1}      0.0889079    0.00990237        8.97845

Forecast the conditional variance for 500 days using the fitted model. Use the observed returns as presample innovations for the forecast.

vF = forecast(EstMdl,500,'Y0',r);

Plot the forecasts, along with the conditional variances inferred from the data.

v = infer(EstMdl,r);

figure
plot(v,'Color',[.7,.7,.7])
hold on
plot(T+1:T+500,vF,'r','LineWidth',2)
xlim([1,T+500])
legend('Inferred','Forecast','Location','Northwest')
title('Conditional Variance Forecasts for NASDAQ Returns')
hold off

Plot conditional variance forecasts for 1000 days.

vF1000 = forecast(EstMdl,1000,'Y0',r);

figure
plot(vF1000,'r','LineWidth',2)
title('Conditional Variance Forecast Asymptote')

The forecasts converge asymptotically to the unconditional variance of the GJR process.

References

[1] Baillie, R., and T. Bollerslev. "Prediction in Dynamic Models with Time-Dependent Conditional Variances." Journal of Econometrics. Vol. 52, 1992, pp. 91–113.

[2] Bollerslev, T. "Generalized Autoregressive Conditional Heteroskedasticity." Journal of Econometrics. Vol. 31, 1986, pp. 307–327.

[3] Bollerslev, T. "A Conditionally Heteroskedastic Time Series Model for Speculative Prices and Rates of Return." The Review of Economics and Statistics. Vol. 69, 1987, pp. 542–547.

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

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

[6] Engle, R. F. "Autoregressive Conditional Heteroskedasticity with Estimates of the Variance of United Kingdom Inflation." Econometrica. Vol. 50, 1982, pp. 987–1007.

[7] Glosten, L. R., R. Jagannathan, and D. E. Runkle. "On the Relation between the Expected Value and the Volatility of the Nominal Excess Return on Stocks." The Journal of Finance. Vol. 48, No. 5, 1993, pp. 1779–1801.

[8] Hamilton, J. D. Time Series Analysis. Princeton, NJ: Princeton University Press, 1994.

Was this topic helpful?