# NAG CL Interfaceg13ffc (uni_​garch_​gjr_​forecast)

## 1Purpose

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)).

## 2Specification

 #include
 void g13ffc (Integer num, Integer nt, Integer p, Integer q, const double theta[], double gamma, double fht[], const double ht[], const double et[], NagError *fail)
The function may be called by the names: g13ffc, nag_tsa_uni_garch_gjr_forecast or nag_forecast_garchgjr.

## 3Description

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 g13fec and the estimated conditional variances and residuals are contained in the arrays ht and et respectively. Then 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.

## 4References

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

## 5Arguments

1: $\mathbf{num}$Integer Input
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: $\mathbf{nt}$Integer Input
On entry: $\tau$, the forecast horizon.
Constraint: ${\mathbf{nt}}>0$.
3: $\mathbf{p}$Integer Input
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: $\mathbf{q}$Integer Input
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: $\mathbf{theta}\left[{\mathbf{q}}+{\mathbf{p}}+1\right]$const double Input
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$.
6: $\mathbf{gamma}$double Input
On entry: the asymmetry argument $\gamma$ for the GARCH$\left(p,q\right)$ sequence.
7: $\mathbf{fht}\left[{\mathbf{nt}}\right]$double Output
On exit: the forecast values of the conditional variance, ${h}_{\mathit{t}}$, for $\mathit{t}=1,2,\dots ,\tau$.
8: $\mathbf{ht}\left[{\mathbf{num}}\right]$const double Input
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: $\mathbf{et}\left[{\mathbf{num}}\right]$const double Input
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: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error 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.

## 8Parallelism and Performance

g13ffc is not threaded in any implementation.