9.3 Nonlinear Models


z = 18728 archest (y, q, p)
estimates the parameters of a GARCH model
h = 18731 archtest (y {,lags {,testform}})
test for ARCH effects
h = 18734 annarchtest (y {,nlags {,nodes {,testform}}})
test for ARCH effects based on neural networks
y = 18737 genarch (a, b, n)
generates an GARCH process with Gaussian innovations
y = 18740 genbil (phi, psi, gamma, noise)
generates a bilinear process
y = 18743 genexpar (thrlag, gamma, phi0, phi1, noise)
generates an exponential AR process
y = 18746 gentar (nr, thrlag, thr, phi, noise)
generates a threshold AR process
18749 gpplot (x, m, k)
returns the Grassberger-Procaccia plot for time series

Nonlinear time series models have been recently explored by many authors. These models became important especially in analyzing financial and economic time series with underlying theoretical models that contain nonlinear relations. Several nonlinear models are implemented in XploRe with special focus on estimating and testing in ARCH and GARCH models which are often used in financial applications.


9.3.1 Several Examples of Nonlinear Models

We speak about a threshold model if the parameters of the model depend on the state of the observed system (random process). In building these models, the real line (please note that we are concerned only with univariate time series here) is divided into $ k$ parts by the set of ordered values $ r_1 < \dots < r_{k-1}$ (these values are called the threshold parameters). Depending on which interval $ (r_j,r_{j+1}]$ contains the value $ Y_t$ the $ j$th set of parameters is used to generate $ Y_{t+d}$. The parameter $ d<k$ is then called a delay parameter. The zero mean threshold AR($ p$) process (TAR($ p$) process) then may be introduced by the equation

$\displaystyle \ Y_t = \phi_1^j Y_{t-1} +\phi_2^j Y_{t-2}+ \ldots + \phi_p^j Y_{t-p} + \varepsilon_t,
$

where $ \varepsilon_t$ is a white noise process and $ j \in \{ 1, \dots, k \}$ is an indicator of the set of parameters to be used, i.e. $ j$ is determined by the condition $ Y_{t-d} \in (r_j,r_{j+1}]$.

The threshold AR($ p$) may be generated in XploRe using 18908 gentar , which has the following syntax:

  y = gentar(nr,thrlag,thr,phi,noise)
where

The following example generates and displays 250 observations of the process

$\displaystyle Y_t$ $\displaystyle =$ $\displaystyle 0.6 \, Y_{t-1} + \varepsilon_t \quad {\rm for} \quad Y_{t-1} \leq 0$  
  $\displaystyle =$ $\displaystyle 0.4 \, Y_{t-1} + \varepsilon_t \quad {\rm for} \quad Y_{t-1} > 0$  

with $ \varepsilon_t \sim N(0,1)$.
  y=gentar(2,1,0,#(0.6,0.4), normal(250))
  timeplot(y)
18912 XLGtimes08.xpl

The class of exponential autoregressive (EAR($ p$)) models with the lag $ d$ is characterized by the relation

$\displaystyle \ Y_t = \sum_{j=1}^p \left[ \phi_j^0 Y_{t-j} + (\phi_j^1 - \phi_j^0) \,
\ \exp (-\gamma \, Y_{t-d})
\right] + \varepsilon_t,
$

where $ \varepsilon_t$ is a white noise process.

The EAR($ p$) process may be generated in XploRe using 18921 genexpar , which has the following syntax:

  y = genexpar(thrlag,gamma,phi0,phi1,noise)
where

The following example generates and displays 250 observations of an EAR($ 2$) process:

  y=genexpar(1,0.1,0.3|0.6, 2.2|-0.8,normal(250))
  timeplot(y)
18925 XLGtimes09.xpl

The resulting time series is shown in Figure 9.6.

Figure 9.6: 250 observations of an EAR($ 2$) process.
\includegraphics[scale=0.425]{times09}

We speak about bilinear model if the process is driven by the relation

$\displaystyle Y_t = \sum_{i=1}^p \phi_i Y_{t-i} + \sum_{j=1}^q
\psi_j \varepsilon_{t-j} + \sum_{i=1}^p \sum_{j=1}^q \gamma_{i,j} Y_{t-i} \varepsilon_{t-j}
$

where $ \varepsilon_t$ is a white noise process.

The bilinear model may be generated in XploRe using 18935 genbil , which has the following syntax:

  y = genbil(phi,psi,gamma,noise)
where

The following example generates and displays 250 observations of a bilinear process, the resulting plot is shown in Figure 9.7.

  y=genbil(0.5|0.2, 0.3|-0.3, 0.8|0|0|0.3,normal(250))
  timeplot(y)
18939 XLGtimes10.xpl

Figure 9.7: 250 observations of a bilinear process.
\includegraphics[scale=0.425]{times10}

Based on the article Grassberger and Procaccia (1983), 18945 gpplot implements the Grassberger-Procaccia plot of time series. This function is applied as follows:

  x=normal(100)
  d=gpplot(x,2,10)
18949 XLGtimes11.xpl

Note that this example does not work in the Academic Edition of XploRe .


9.3.2 Nonlinearity in the Conditional Second Moments

A family of models with conditional heteroscedasticity is lately very popular especially among econometricians analyzing financial time series. This family may be introduced by a general formula

$\displaystyle Y_t = f(Y_{t-1}, \dots, Y_{t-\tau}) + \varepsilon_t, \quad t=1,\ldots,T
\quad \textrm{with} \quad \varepsilon_t\vert I_t \sim N(0,\sigma^2_t)
$

where $ I_t$ is the information set available at time $ t$. The conditional variance $ \sigma^2_t$ is a function of the information contained in the set $ I_t$. We consider here the class of ARCH/GARCH models which restricts the information set $ I_t$ to the sequence of past squared disturbances $ \varepsilon_t^2$.

ARCH models

The class of ARCH models represents the conditional variance $ \sigma_t^2$ at time $ t$ as a function of the past squared disturbances

$\displaystyle \ \sigma^2_t = \omega + \sum_{i=1}^q \alpha_i \varepsilon_{t-i}^2.
$

This defines an ARCH($ q$) process where $ q$ is the order of the autoregressive lag polynomial $ \alpha(L)=\alpha_1 L + \ldots + \alpha_q L^q$. This class of processes is generalized and nested in the class of generalized ARCH processes, denoted as GARCH and defined by the relation

$\displaystyle \ \sigma^2_t = \omega + \sum_{i=1}^q \alpha_i \varepsilon_{t-i}^2...
...gma_{t-j}^2 = \omega + \alpha(L) \varepsilon_{t}^2 +
\ \beta(L) \sigma_{t}^2 .
$

This defines a GARCH($ p,q$) process, where $ p$ and $ q$ are the respective orders of the autoregressive and moving average lag polynomials. The moving average lag polynomial is defined as $ \beta(L)=\beta_1 L + \ldots + \beta_p L^p$.

An GARCH process can be generated using 19169 genarch , which has the following syntax:

  y = genarch(a,b,n)
where If the absolute value of the sum of coefficients of the autoregressive and moving average polynomials is greater than 1, i.e. if the generated process is not stationary, XploRe displays an error message.

In the following example, 250 observations of a GARCH(1,1) process are generated and displayed:

  a = #(1,0.45)        ; AR part of GARCH errors
  b = #(0.5)           ; MA part of GARCH errors
  y = genarch(a,b,250)
19177 XLGtimes12.xpl

Figure 9.8 shows the process.

Figure 9.8: 250 observations of a GARCH(1,1) process.
\includegraphics[scale=0.425]{times12}

The displayed time series shows that the GARCH process is characterized by the clustering of large deviating observations. This occurs typically in financial time series.

We can verify that the generated series is leptokurtic by evaluating its kurtosis with the command 19183 kurtosis (y) which yields the following output:

  Contents of k
  [1,]   7.1956
This value is greater than the kurtosis of the Gaussian distribution, i.e. 3. This feature is common to all ARCH and GARCH processes.


9.3.3 Estimating ARCH Models

ARCH/GARCH models are estimated in the time domain by the maximum likelihood method. This implies that we have to make an assumption about the distribution of the error terms. Usually the assumption of normality is sufficient and simplifies the estimation procedure. However, in some cases, this normality assumption is not sufficient for capturing the leptokurtosis of the sample under investigation. In that case we have to resort to other fat tailed distributions, such as the Student or the generalized exponential distribution.

Under the assumption of Gaussian innovations, we can estimate the parameters of a GARCH process using 19286 archest . Its syntax is as follows:

  z = archest(y,q,p)
where To estimate the parameters of the previously generated process, type:
  z = archest(y,1,1)

The quantlet 19289 archest estimates the parameters, their standard errors, and stores them in the form of a list. The first element of the list, z{1} contains the set of parameters, the second element of the list, z{2} contains the standard errors of estimates. Typing z{1} yields the parameter estimates

  [1,]   1.9675 
  [2,]  0.40522 
  [3,]  0.42373
Typing z{2} returns the estimated standard errors
  [1,]  0.57227 
  [2,]  0.07518 
  [3,]  0.077201
Note that 19292 archest returns additional values. For their description consult the APSS help file.


9.3.4 Testing for ARCH

We test for ARCH effects by investigating whether the components of the autoregressive lag polynomial are all equal to zero. Two formulations for a test for ARCH are usually considered:

Both tests are asymptotically equivalent, and asymptotically distributed as $ \chi^2_n$ under the null hypothesis.

The XploRe quantlet 19487 archtest performs these two tests. Its syntax is

  h = archtest(y {,lags {,testform}})
where This function returns a table: The first column contains the order of the test, the second column contains the value of the test, the third column contains the 95% critical value for the respective order, and the fourth column contains the $ p$-value of the test.

In our generated sample of observations, we test for ARCH with the command

  archtest(y,"TR2")
This calculates the $ R^2$ form of the ARCH test for the default lags 2, 3, 4 and 5. The results are displayed in the form of a table:
[1,] Lag order  Statistic  95% Critical Value  P-Value 
[2,] __________________________________________________
[3,] 
[4,]      2     85.45238         5.97378       0.00000
[5,]      3    105.05328         7.80251       0.00000
[6,]      4    104.68014         9.47844       0.00000
[7,]      5    105.15906        11.06309       0.00000
We recommend to consult the APSS help file of 19490 archest and to play around with the numerous variants of this quantlet.

Kamstra (1993), Caulet and Péguin-Feissolle (1997) and Péguin-Feissolle (1999) consider a general nonparametric test for ARCH based on neural networks, in the spirit of the Lee, White and Granger (1993) nonlinearity test presented above. Caulet and Péguin-Feissolle (1997) consider the following parameterization of the conditional variance

$\displaystyle \ \sigma^2_t = \beta_0 + \sum_{j=1}^q \frac{\beta_j} {1+\exp\{-(\...
...j0}+\gamma_{j1}\varepsilon_{t-1}^2+\ldots+\gamma_{jn}\varepsilon_{t-n}^2)\}}\,.$ (9.1)

Péguin-Feissolle (1999) considers the more general case

$\displaystyle \sigma^2_t = \beta_0 + \sum_{j=1}^q \frac{\beta_j}
{1+\exp\{-(\gamma_{j0}+\gamma_{j1}\varepsilon_{t-1}+\ldots+\gamma_{jn}\varepsilon_{t-n})\}},
$

i.e. extends the $ \sigma$-field of the information set from the set of squared residuals to the set of residuals. This extended test appears to be more powerful than other tests for ARCH when the data generating process is a nonstandard one. The parameters $ \gamma_{i,j}$ are randomly generated for solving the problem of parameter identification under the null hypothesis. All these neural network based test statistics are asymptotically $ \chi^2_n$ distributed under the null hypothesis.

The quantlet 19493 annarchtest evaluates the Lagrange multiplier form and the $ R^2$ form for the specification (9.1). Its syntax is

  h = annarchtest(y, {,nlags {,nodes {,testform}}})
where This function returns the results in the form of a table: The first column contains the number of lags in the auxiliary regression, the second column contains the number of hidden nodes, the third column contains the calculated statistic, the fourth column contains the 95% critical value for that order, and the last column contains the $ p$-value of the test.

We calculate the test for ARCH based on neural networks with the command

  annarchtest(y)
This returns
[1,] Lag order  Nb of hidden Statistic  95% Critical Value  P-Value 
[2,]             units 
[3,] ______________________________________________________________ 
[4,] 
[5,]      2         3         26.56036       5.97378        0.00000
[6,]      3         3         60.80811       7.80251        0.00000
[7,]      4         3         14.44156       9.47844        0.00601
[8,]      5         3         27.32019      11.06309        0.00005