| GARCH Toolbox™ | ![]() |
| On this page… |
|---|
The section Example: Analysis and Estimation Using the Default Model uses the default GARCH(1,1) model to model the Deutschmark/British pound foreign-exchange series. This example shows how to forecast with the garchpred function, using the model:
![]()
![]()
Use the following commands to restore your workspace if necessary:
load garchdata
dem2gbp = price2ret(DEM2GBP);
[coeff,errors,LLF,innovations,sigmas] = garchfit(dem2gbp);
garchdisp(coeff,errors)
Mean: ARMAX(0,0,0); Variance: GARCH(1,1)
Conditional Probability Distribution: Gaussian
Number of Model Parameters Estimated: 4
Standard T
Parameter Value Error Statistic
----------- ----------- ------------ -----------
C -6.1919e-005 8.4331e-005 -0.7342
K 1.0761e-006 1.323e-007 8.1341
GARCH(1) 0.80598 0.016561 48.6685
ARCH(1) 0.15313 0.013974 10.9586
Due to space constraints, the display output of the estimation is not included here.
Call garchpred to forecast the returns for the Deutschmark/British pound foreign-exchange series using the default model parameter estimates. Provide the specification structure coeff (the output of garchfit) and the FX return series dem2gbp, and the number of forecast periods as input:
Note The following example results appear in Short E numeric format for readability. Select File > Preferences > Command Window > Text display: short e before starting the example to duplicate this format. |
Use the following command to forecast the conditional mean and standard deviation in each period of a 10-period forecast horizon:
[sigmaForecast,meanForecast] = garchpred(coeff,dem2gbp,10); [sigmaForecast,meanForecast] ans = 3.8340e-003 -6.1919e-005 3.8954e-003 -6.1919e-005 3.9535e-003 -6.1919e-005 4.0084e-003 -6.1919e-005 4.0603e-003 -6.1919e-005 4.1095e-003 -6.1919e-005 4.1562e-003 -6.1919e-005 4.2004e-003 -6.1919e-005 4.2424e-003 -6.1919e-005 4.2823e-003 -6.1919e-005
The result consists of the MMSE forecasts of the conditional standard deviations and the conditional mean of the return series dem2gbp for a 10-period default horizon. They show that the default model forecast of the conditional mean is always C=-6.1919e-05. This is true for any forecast horizon because the expected value of any innovation, εt, is 0.
The conditional standard deviation forecast (sigmaForecast) changes from period to period and approaches the unconditional standard deviation of {εt}, given by

Calculate the unconditional standard deviation of{εt}:
s0 = sqrt(coeff.K/(1 - sum([coeff.GARCH(:);coeff.ARCH(:)])))
s0 =
5.1300e-003
Plot the unconditional standard deviation, 5.1300e-003, and the conditional standard deviations, sigmas, derived from the fitted returns. The plot shows that the most recent values of {σt} fall below this long-run, asymptotic value:
plot(sigmas), hold('on')
plot([0 size(sigmas,1)],[s0 s0],'red')
title('Fitted Conditional Standard Deviations')
hold('off')

In addition to computing conditional mean and volatility forecasts on a per-period basis, garchpred also computes volatility forecasts of returns for assets held for multiple periods. For example, you can forecast the standard deviation of the return you would obtain if you purchased shares in a mutual fund that mirrors the performance of the New York Stock Exchange Composite Index today, and sold it 10 days from now.
Use the default GARCH(1,1) model (The Default Model) to estimate the model parameters for the NYSE data set. The following text omits the display output of the estimation to save space:
load garchdata
nyse = price2ret(NYSE);
[coeff,errors,LLF,innovations,sigmas] = garchfit(nyse);
garchdisp(coeff,errors)
Mean: ARMAX(0,0,0); Variance: GARCH(1,1)
Conditional Probability Distribution: Gaussian
Number of Model Parameters Estimated: 4
Standard T
Parameter Value Error Statistic
----------- ----------- ------------ -----------
C 0.00049676 0.00013137 3.7813
K 8.9128e-007 1.5776e-007 5.6495
GARCH(1) 0.91088 0.0069142 131.7410
ARCH(1) 0.079942 0.0058319 13.7077
Now, forecast and plot the standard deviation of the return you would obtain if you sold the shares after 10 days.
[sigmaForecast,meanForecast,sigmaTotal] = garchpred(coeff,...
nyse,10);
plot(sigmaTotal)
ylabel('Standard Deviations')
xlabel('Periods')
title('10-Period Volatility Forecast')
hold('off')

This plot represents the standard deviation of the returns (sigmaTotal) expected if you held the shares for the number of periods shown on the x-axis. The value for the tenth period is the volatility forecast of the expected return if you purchased the shares today and held them for 10 periods. The calculation of sigmaTotal is strictly correct for continuously compounded returns only, and is an approximation for periodically compounded returns.
Convert the standard deviations sigmaForecast and sigmaTotal to variances by squaring each element. You then see an interesting relationship between the cumulative sum of sigmaForecast.^2 and sigmaTotal.^2:
format short e [cumsum(sigmaForecast.^2) sigmaTotal.^2] ans = 5.4587e-005 5.4587e-005 1.0956e-004 1.0956e-004 1.6493e-004 1.6493e-004 2.2068e-004 2.2068e-004 2.7680e-004 2.7680e-004 3.3331e-004 3.3331e-004 3.9018e-004 3.9018e-004 4.4743e-004 4.4743e-004 5.0504e-004 5.0504e-004 5.6302e-004 5.6302e-004
Although not equivalent, this relationship in the presence of heteroscedasticity is like the square-root-of-time rule. This familiar rule converts constant variances of uncorrelated returns expressed on a per-period basis to a variance over multiple periods. This relationship between sigmaForecast and sigmaTotal holds for the default conditional mean model only (the relationship is valid for uncorrelated returns).
This example illustrates how to forecast multiple realizations of an MA(1) conditional mean model with an EGARCH(1,1) conditional variance model.
Load the NYSE data set and convert prices to returns:
load garchdata nyse = price2ret(NYSE);
Create a specification structure template, and estimate and display the estimation results:
spec = garchset('VarianceModel','EGARCH','M',1,'P',1,'Q',1,...
'Display','off');
[coeff,errors] = garchfit(spec,nyse);
garchdisp(coeff,errors)
Mean: ARMAX(0,1,0); Variance: EGARCH(1,1)
Conditional Probability Distribution: Gaussian
Number of Model Parameters Estimated: 6
Standard T
Parameter Value Error Statistic
----------- ----------- ------------ -----------
C 0.00022434 0.00014038 1.5981
MA(1) 0.10677 0.018795 5.6806
K -0.25399 0.031452 -8.0755
GARCH(1) 0.97329 0.003231 301.2365
ARCH(1) 0.14514 0.011845 12.2533
Leverage(1) -0.10359 0.0081483 -12.7128
Based on the estimation results, do the following:
Simulate 1000 observations for each of three independent realizations.
Forecast the conditional standard deviations and returns for a 10-period forecast horizon.
randn('state',0);
rand('twister',0);
[innovations,sigmas,series] = garchsim(coeff,1000,3);
[sigmaForecast,meanForecast]= garchpred(coeff,series,10);
The sigmaForecast and meanForecast outputs are 10-by-3 arrays. Both arrays have the same number of rows as the specified number of periods. The first row contains the standard deviations and mean forecasts for the first period, and the last row contains these values for the most recent period. Both arrays have the same number of columns as there are realizations, that is, columns, in the simulated return series, series.

![]() | Asymptotic Behavior for Long-Range Forecast Horizons | Regression Components | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |