g13 Chapter Contents
g13 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_forecast_garchGJR (g13ffc)

## 1  Purpose

nag_forecast_garchGJR (g13ffc) forecasts the conditional variances, ${h}_{t}$, $t=1,\dots ,\tau$ from a GJR GARCH$\left(p,q\right)$ sequence, where $\tau$ is the forecast horizon (see Glosten et al. (1993)).

## 2  Specification

 #include #include
 void nag_forecast_garchGJR (Integer num, Integer nt, Integer p, Integer q, const double theta[], double gamma, double fht[], const double ht[], const double et[], NagError *fail)

## 3  Description

Assume the GARCH$\left(p,q\right)$ process can be represented by:
 $ε t ∣ ψ t-1 ∼ N 0, h t$
 $h t = α 0 + ∑ i=1 q α i + γ S t-i ε t-i 2 + ∑ i=1 p β i h t-i , t = 1 , … , T .$
where ${S}_{t}=1$, if ${\epsilon }_{t}<0$, and ${S}_{t}=0$, if ${\epsilon }_{t}\ge 0$ has been modelled by nag_estimate_garchGJR (g13fec) and the estimated conditional variances and residuals are contained in the arrays ht and et respectively. Then nag_forecast_garchGJR (g13ffc) will 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+\tau$ and $\tau$ 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  Arguments

1:     numIntegerInput
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{p}},{\mathbf{q}}\right)\le {\mathbf{num}}$.
2:     ntIntegerInput
On entry: $\tau$, the forecast horizon.
Constraint: ${\mathbf{nt}}>0$.
3:     pIntegerInput
On entry: the GARCH$\left(p,q\right)$ argument $p$.
Constraint: $0<\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{p}},{\mathbf{q}}\right)\le {\mathbf{num}}\text{, ​}{\mathbf{p}}\ge 0$.
4:     qIntegerInput
On entry: the GARCH$\left(p,q\right)$ argument $q$.
Constraint: $0<\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{p}},{\mathbf{q}}\right)\le {\mathbf{num}}\text{, ​}{\mathbf{q}}\ge 1$.
5:     theta[${\mathbf{q}}+{\mathbf{p}}+1$]const doubleInput
On entry: the first element must contain the coefficient ${\alpha }_{o}$ and the next q elements must contain the coefficients ${\alpha }_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,q$. The remaining p elements must contain the coefficients ${\beta }_{\mathit{j}}$, for $\mathit{j}=1,2,\dots ,p$.
On entry: the asymmetry argument $\gamma$ for the GARCH$\left(p,q\right)$ sequence.
7:     fht[nt]doubleOutput
On exit: the forecast values of the conditional variance, ${h}_{\mathit{t}}$, for $\mathit{t}=1,2,\dots ,\tau$.
8:     ht[num]const doubleInput
On entry: the sequence of past conditional variances for the GARCH$\left(p,q\right)$ process, ${h}_{\mathit{t}}$, for $\mathit{t}=1,2,\dots ,T$.
9:     et[num]const doubleInput
On entry: the sequence of past residuals for the GARCH$\left(p,q\right)$ process, ${\epsilon }_{\mathit{t}}$, for $\mathit{t}=1,2,\dots ,T$.
10:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_2_INT_ARG_LT
On entry, ${\mathbf{num}}=⟨\mathit{\text{value}}⟩$ while $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{p}},{\mathbf{q}}\right)=⟨\mathit{\text{value}}⟩$. These arguments must satisfy ${\mathbf{num}}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{p}},{\mathbf{q}}\right)$.
NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_INT_ARG_LT
On entry, ${\mathbf{nt}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{nt}}\ge 1$.
On entry, ${\mathbf{num}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{num}}\ge 0$.
On entry, ${\mathbf{p}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{p}}\ge 0$.
On entry, ${\mathbf{q}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{q}}\ge 1$.

Not applicable.

Not applicable.