G13 Chapter Contents
G13 Chapter Introduction
NAG Library Manual

# NAG Library Routine DocumentG13FHF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

## 1  Purpose

G13FHF forecasts the conditional variances, ${h}_{t},t=T+1,\dots ,T+\xi$ from an exponential $\text{GARCH}\left(p,q\right)$ sequence, where $\xi$ is the forecast horizon and $T$ is the current time (see Engle and Ng (1993)).

## 2  Specification

 SUBROUTINE G13FHF ( NUM, NT, IP, IQ, THETA, FHT, HT, ET, IFAIL)
 INTEGER NUM, NT, IP, IQ, IFAIL REAL (KIND=nag_wp) THETA(2*IQ+IP+1), FHT(NT), HT(NUM), ET(NUM)

## 3  Description

Assume the $\text{GARCH}\left(p,q\right)$ process represented by:
 $lnht=α0+∑i=1qαizt-i+∑j=1qϕizt-j-Ezt-i+∑j=1pβilnht-j, t=1,2,…,T.$
where ${\epsilon }_{t}\mid {\psi }_{t-1}=N\left(0,{h}_{t}\right)$ or ${\epsilon }_{t}\mid {\psi }_{t-1}={S}_{t}\left(\mathit{df},{h}_{t}\right)$, and ${z}_{t}=\frac{{\epsilon }_{t}}{\sqrt{{h}_{t}}}$, $E\left[\left|{z}_{t-i}\right|\right]$ denotes the expected value of $\left|{z}_{t-i}\right|$, has been modelled by G13FGF, and the estimated conditional variances and residuals are contained in the arrays HT and ET respectively.
G13FHF will then use the last $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(p,q\right)$ elements of the arrays HT and ET to estimate the conditional variance forecasts, ${h}_{t}\mid {\psi }_{T}$, where $t=T+1,\dots ,T+\xi$ and $\xi$ is the forecast horizon.

## 4  References

Bollerslev T (1986) Generalised autoregressive conditional heteroskedasticity Journal of Econometrics 31 307–327
Engle R (1982) Autoregressive conditional heteroskedasticity with estimates of the variance of United Kingdom inflation Econometrica 50 987–1008
Engle R and Ng V (1993) Measuring and testing the impact of news on volatility Journal of Finance 48 1749–1777
Glosten L, Jagannathan R and Runkle D (1993) Relationship between the expected value and the volatility of nominal excess return on stocks Journal of Finance 48 1779–1801
Hamilton J (1994) Time Series Analysis Princeton University Press

## 5  Parameters

1:     NUM – INTEGERInput
On entry: the number of terms in the arrays HT and ET from the modelled sequence.
Constraint: $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{IP}},{\mathbf{IQ}}\right)\le {\mathbf{NUM}}$.
2:     NT – INTEGERInput
On entry: $\xi$, the forecast horizon.
Constraint: ${\mathbf{NT}}>0$.
3:     IP – INTEGERInput
On entry: the number of coefficients, ${\beta }_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,p$.
Constraints:
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{IP}},{\mathbf{IQ}}\right)\le 20$;
• ${\mathbf{IP}}\ge 0$.
4:     IQ – INTEGERInput
On entry: the number of coefficients, ${\alpha }_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,q$.
Constraints:
• $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{IP}},{\mathbf{IQ}}\right)\le 20$;
• ${\mathbf{IQ}}\ge 1$.
5:     THETA($2×{\mathbf{IQ}}+{\mathbf{IP}}+1$) – REAL (KIND=nag_wp) arrayInput
On entry: the initial parameter estimates for the vector $\theta$. The first element must contain the coefficient ${\alpha }_{o}$ and the next IQ elements must contain the autoregressive coefficients ${\alpha }_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,q$. The next IQ elements must contain the coefficients ${\varphi }_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,q$. The next IP elements must contain the moving average coefficients ${\beta }_{\mathit{j}}$, for $\mathit{j}=1,2,\dots ,p$.
6:     FHT(NT) – REAL (KIND=nag_wp) arrayOutput
On exit: the forecast values of the conditional variance, ${h}_{t}$, for $\mathit{t}=T+1,\dots ,T+\xi$.
7:     HT(NUM) – REAL (KIND=nag_wp) arrayInput
On entry: the sequence of past conditional variances for the $\text{GARCH}\left(p,q\right)$ process, ${h}_{\mathit{t}}$, for $\mathit{t}=1,2,\dots ,T$.
8:     ET(NUM) – REAL (KIND=nag_wp) arrayInput
On entry: the sequence of past residuals for the $\text{GARCH}\left(p,q\right)$ process, ${\epsilon }_{\mathit{t}}$, for $\mathit{t}=1,2,\dots ,T$.
9:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to $0$, $-1\text{​ or ​}1$. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value $-1\text{​ or ​}1$ is recommended. If the output of error messages is undesirable, then the value $1$ is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is $0$. When the value $-\mathbf{1}\text{​ or ​}\mathbf{1}$ is used it is essential to test the value of IFAIL on exit.
On exit: ${\mathbf{IFAIL}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6  Error Indicators and Warnings

If on entry ${\mathbf{IFAIL}}={\mathbf{0}}$ or $-{\mathbf{1}}$, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
${\mathbf{IFAIL}}=1$
 On entry, ${\mathbf{NUM}}<\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{IP}},{\mathbf{IQ}}\right)$, or ${\mathbf{IQ}}<1$, or ${\mathbf{IP}}<0$, or $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{IP}},{\mathbf{IQ}}\right)>20$, or ${\mathbf{NT}}\le 0$.

Not applicable.