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

# Syntax

C#
```public static void g13fh(
int num,
int nt,
int ip,
int iq,
double[] theta,
double[] fht,
double[] ht,
double[] et,
out int ifail
)```
Visual Basic
```Public Shared Sub g13fh ( _
num As Integer, _
nt As Integer, _
ip As Integer, _
iq As Integer, _
theta As Double(), _
fht As Double(), _
ht As Double(), _
et As Double(), _
<OutAttribute> ByRef ifail As Integer _
)```
Visual C++
```public:
static void g13fh(
int num,
int nt,
int ip,
int iq,
array<double>^ theta,
array<double>^ fht,
array<double>^ ht,
array<double>^ et,
[OutAttribute] int% ifail
)```
F#
```static member g13fh :
num : int *
nt : int *
ip : int *
iq : int *
theta : float[] *
fht : float[] *
ht : float[] *
et : float[] *
ifail : int byref -> unit
```

#### Parameters

num
Type: System..::..Int32
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}}$.
nt
Type: System..::..Int32
On entry: $\xi$, the forecast horizon.
Constraint: ${\mathbf{nt}}>0$.
ip
Type: System..::..Int32
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$.
iq
Type: System..::..Int32
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$.
theta
Type: array<System..::..Double>[]()[][]
An array of size [$2×{\mathbf{iq}}+{\mathbf{ip}}+1$]
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$.
fht
Type: array<System..::..Double>[]()[][]
An array of size [nt]
On exit: the forecast values of the conditional variance, ${h}_{t}$, for $\mathit{t}=T+1,\dots ,T+\xi$.
ht
Type: array<System..::..Double>[]()[][]
An array of size [num]
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$.
et
Type: array<System..::..Double>[]()[][]
An array of size [num]
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$.
ifail
Type: System..::..Int32%
On exit: ${\mathbf{ifail}}={0}$ unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

# 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 g13fg, and the estimated conditional variances and residuals are contained in the arrays ht and et respectively.
g13fh 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.

# 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

# Error Indicators and Warnings

Errors or warnings detected by the method:
${\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$.
${\mathbf{ifail}}=-9000$
An error occured, see message report.
${\mathbf{ifail}}=-8000$
Negative dimension for array $〈\mathit{\text{value}}〉$
${\mathbf{ifail}}=-6000$
Invalid Parameters $〈\mathit{\text{value}}〉$

Not applicable.

None.