g13 Chapter Contents
g13 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_forecast_agarchII (g13fdc)

## 1  Purpose

nag_forecast_agarchII (g13fdc) forecasts the conditional variances, ${h}_{t}$, $t=1,\dots ,\tau$ from a type II AGARCH$\left(p,q\right)$ sequence, where $\tau$ is the forecast horizon (see Engle and Ng (1993)).

## 2  Specification

 #include #include
 void nag_forecast_agarchII (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 ε t-i + γ ε t-i 2 + ∑ i=1 p β i h t-i , t = 1 , … , T$
has been modelled by nag_estimate_agarchII (g13fcc) and the estimated conditional variances and residuals are contained in the arrays ht and et respectively. Then nag_forecast_agarchII (g13fdc) 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
Hamilton J (1994) Time Series Analysis Princeton University Press

## 5  Arguments

1:    $\mathbf{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{p}},{\mathbf{q}}\right)\le {\mathbf{num}}$.
2:    $\mathbf{nt}$IntegerInput
On entry: $\tau$, the forecast horizon.
Constraint: ${\mathbf{nt}}>0$.
3:    $\mathbf{p}$IntegerInput
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}$IntegerInput
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 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$.
6:    $\mathbf{gamma}$doubleInput
On entry: the asymmetry argument $\gamma$ for the GARCH$\left(p,q\right)$ sequence.
7:    $\mathbf{fht}\left[{\mathbf{nt}}\right]$doubleOutput
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 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:    $\mathbf{et}\left[{\mathbf{num}}\right]$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:  $\mathbf{fail}$NagError *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.