This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Forecast Conditional Mean and Variance Model

This example shows how to forecast responses and conditional variances from a composite conditional mean and variance model.

Step 1. Load the data and fit a model.

Load the NASDAQ data included with the toolbox. Fit a conditional mean and variance model to the data.

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

Mdl = arima('ARLags',1,'Variance',garch(1,1),...
EstMdl = estimate(Mdl,r,'Variance0',{'Constant0',0.001});
    ARIMA(1,0,0) Model (t Distribution):
                  Value      StandardError    TStatistic      PValue  
                _________    _____________    __________    __________

    Constant    0.0010372     0.00017087        6.0701      1.2781e-09
    AR{1}         0.14282       0.019368        7.3743      1.6517e-13
    DoF            7.5775        0.93221        8.1285      4.3453e-16

    GARCH(1,1) Conditional Variance Model (t Distribution):
                  Value       StandardError    TStatistic      PValue  
                __________    _____________    __________    __________

    Constant    1.5709e-06     6.4082e-07        2.4515        0.014227
    GARCH{1}       0.89364       0.011714        76.285               0
    ARCH{1}         0.1036       0.012204        8.4888       2.087e-17
    DoF             7.5775        0.93221        8.1285      4.3453e-16
[E0,V0] = infer(EstMdl,r);

Step 2. Forecast returns and conditional variances.

Use forecast to compute MMSE forecasts of the returns and conditional variances for a 1000-period future horizon. Use the observed returns and inferred residuals and conditional variances as presample data.

[Y,YMSE,V] = forecast(EstMdl,1000,r,'E0',E0,'V0',V0);
upper = Y + 1.96*sqrt(YMSE);
lower = Y - 1.96*sqrt(YMSE);

hold on
title('Forecasted Returns')
hold off
hold on
title('Forecasted Conditional Variances')
hold off

The conditional variance forecasts converge to the asymptotic variance of the GARCH conditional variance model. The forecasted returns converge to the estimated model constant (the unconditional mean of the AR conditional mean model).

See Also



Related Examples

More About