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. Please click here
To view all translated materials including this page, select Japan 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);

model = arima('ARLags',1,'Variance',garch(1,1),...
fit = estimate(model,r,'Variance0',{'Constant0',0.001});
    ARIMA(1,0,0) Model:
    Conditional Probability Distribution: t

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant     0.00102703       0.00017        6.04137
        AR{1}       0.145703     0.0192289        7.57732
          DoF        7.37236      0.898406        8.20604
    GARCH(1,1) Conditional Variance Model:
    Conditional Probability Distribution: t

                                  Standard          t     
     Parameter       Value          Error       Statistic 
    -----------   -----------   ------------   -----------
     Constant     1.6663e-06   6.51093e-07        2.55923
     GARCH{1}       0.891952      0.011931        74.7591
      ARCH{1}       0.103971     0.0123007        8.45245
          DoF        7.37236      0.898406        8.20604
[E0,V0] = infer(fit,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(fit,1000,'Y0',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

Was this topic helpful?