# 9.3 Nonlinear Models

 z = archest (y, q, p) estimates the parameters of a GARCH model h = archtest (y {,lags {,testform}}) test for ARCH effects h = annarchtest (y {,nlags {,nodes {,testform}}}) test for ARCH effects based on neural networks y = genarch (a, b, n) generates an GARCH process with Gaussian innovations y = genbil (phi, psi, gamma, noise) generates a bilinear process y = genexpar (thrlag, gamma, phi0, phi1, noise) generates an exponential AR process y = gentar (nr, thrlag, thr, phi, noise) generates a threshold AR process 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 parts by the set of ordered values (these values are called the threshold parameters). Depending on which interval contains the value the th set of parameters is used to generate . The parameter is then called a delay parameter. The zero mean threshold AR() process (TAR() process) then may be introduced by the equation

where is a white noise process and is an indicator of the set of parameters to be used, i.e. is determined by the condition .

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

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

where
• nr is the number of threshold regions,
• thrlag is the threshold lag (the delay parameter),
• thr is a (nr-1)-dimensional vector of the threshold parameters that separates the regions,
• phi is a (nr*p)-dimensional vector of the AR parameters for all regions sorted as follows

• noise is an -dimensional vector of the noise ( is the number of observations to be generated).

The following example generates and displays 250 observations of the process

with .
  y=gentar(2,1,0,#(0.6,0.4), normal(250))
timeplot(y)


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

where is a white noise process.

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

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

where
• thrlag is the threshold lag (the delay parameter),
• gamma is a positive parameter of the exponential function,
• phi0 is a -dimensional vector of AR parameters ,
• phi1 is a -dimensional vector of AR parameters ,
• noise is an -dimensional vector of the noise ( is the number of observations to be generated).

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

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


The resulting time series is shown in Figure 9.6.

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

where is a white noise process.

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

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

where
• phi is a -dimensional vector of the AR parameters,
• psi is a -dimensional vector of the MA parameters,
• gamma is a -dimensional vector of the bilinear parameters sorted as

• noise is an -dimensional vector of the noise ( is the number of observations to be generated).

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)


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

  x=normal(100)
d=gpplot(x,2,10)


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

where is the information set available at time . The conditional variance is a function of the information contained in the set . We consider here the class of ARCH/GARCH models which restricts the information set to the sequence of past squared disturbances .

ARCH models

The class of ARCH models represents the conditional variance at time as a function of the past squared disturbances

This defines an ARCH() process where is the order of the autoregressive lag polynomial . This class of processes is generalized and nested in the class of generalized ARCH processes, denoted as GARCH and defined by the relation

This defines a GARCH() process, where and are the respective orders of the autoregressive and moving average lag polynomials. The moving average lag polynomial is defined as .

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

  y = genarch(a,b,n)

where
• a is the vector which contains the constant and the coefficient of the autoregressive lag polynomial,
• b is the vector of parameters of the moving average lag polynomial,
• n is the size of the simulated series.
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)


Figure 9.8 shows the process.

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 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 archest . Its syntax is as follows:

  z = archest(y,q,p)

where
• y is the series of observations,
• p is the order of the polynomial,
• q is the order of the polynomial.
To estimate the parameters of the previously generated process, type:
  z = archest(y,1,1)


The quantlet 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 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:

• The Lagrange Multiplier test statistic, given by

where is the -dimensional vector of estimated endogenous variables in the auxiliary regression

Here are the residuals from the regression model, and .
• The form, with the test statistic equal to

where is the squared multiple value of the regression of on an intercept and lagged values of .
Both tests are asymptotically equivalent, and asymptotically distributed as under the null hypothesis.

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

  h = archtest(y {,lags {,testform}})

where
• y is the vector of residuals.
• lags is the number of lags in the auxiliary regression. This argument may either be a scalar or a vector. In the latter case, the statistics is computed for all the order components of the vector. By default, the lag orders 2, 3, 4, and 5 are computed.
• testform is the form of the test. This argument is a string which can be either "LM" or "TR2". In the former case the Lagrange multiplier form is evaluated, while in the latter case the form is computed.
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 -value of the test.

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

  archtest(y,"TR2")

This calculates the 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 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

 (9.1)

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

i.e. extends the -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 are randomly generated for solving the problem of parameter identification under the null hypothesis. All these neural network based test statistics are asymptotically distributed under the null hypothesis.

The quantlet annarchtest evaluates the Lagrange multiplier form and the form for the specification (9.1). Its syntax is

  h = annarchtest(y, {,nlags {,nodes {,testform}}})

where
• y is the vector of residuals.
• nlags is the number of lags in the auxiliary regression. This second argument may either be a vector or a scalar. If this argument is a vector, the test will be calculated for all order components of this vector. By default, the number of lags is set to 2, 3, 4 and 5.
• nodes is the number of hidden nodes in the neural network architecture. This argument may either be a vector or a scalar. By default, nodes is set to 3.
• If both the second and third arguments are vectors, the statistic will be calculated for all combinations of the second and third arguments.
• testform is the form of the test, which -- as in the previous case -- is either "LM" or "TR2" depending on the form of the test you wish to compute. By default, the "LM" form is calculated.
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 -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