Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: times
See also: annarchtest

Quantlet: annlintest
Description: calculates the neural network test for neglected nonlinearity proposed by Lee, White and Granger (1993). This statistic is evaluated from uncentered squared multiple correlation of an auxiliary regression in which the residuals are regressed on the original regressors and the principal components of a nonlinear transformation of the regressors.

Reference(s):

Usage: NLT = annlintest (y, x{, units{, principal_components}})
Input:
y n x 1 vector of the time series
x n x p matrix, a set of regressors x if the series is regressed on x, or the number of lags if the series is regressed on its lagged realizations.
units optional vector, number of hidden units of the neural network, default is (10,20)
principal components optional vector, number of principal components used in the auxiliary regression. It should be less than the number of corresponding hidden units. Default is (2,3).
Output:
NLT vector of strings. If the series is regressed on a set of exogeneous variables x, the quantlet returns the number of principal components used in the auxiliary regression, the value of the test statistic, the 95% critical value for the null hypothesis, and the P-value of the test statistic. If the series is regressed on its past realizations, the number of lagged explanatory variables is also displayed.

Note:

Example:
; We calculate the test for neglected nonlinearity. As the
; second argument is equal to two, the series is regressed on
; two lagged values. Since there is no third and fourth argument,
; the number of hidden units is equal to the default numbers, i.e.,
; 10 and 20, and the default number of principal components is
; equal to 2 and 3, as displayed in the output.
library("times") ; loads the library times
randomize(1)     ; sets the seed
y = gentar(2,1,0,0.5|-0.5,normal(400))
q = annlintest(y,2)
q

Result:
Contents of q

[1,] "Number of Principal  Number of  Statistic  95% Critical Value  P-Value "
[2,] "    Components          lags                                           "
[3,] "_______________________________________________________________________"
[4,] "                                                                       "
[5,] "          2              2      12.14334         5.99146       0.00231 "
[6,] "          3              2      10.27117         7.81473       0.01640 "
Example:
; We calculate the test for the case that y is regressed on three
; lagged realizations. The number of hidden units is given by the
; vector hu, i.e., we consider the cases with 10, 20 and 30
; hidden units. The number of principal components is given in
; the vector pcomp, and are respectively equal to 2, 3, and 4,
; as displayed in the output.
library("times")  ; loads the library times
randomize(1)      ; sets the seed
y     = gentar(2,1,0,0.5|-0.5,normal(400))
hu    = #(10,20,30)
pcomp = #(2,3,4)
q     = annlintest(y,3,hu,pcomp)
q

Result:
Contents of q
[1,] "Number of Principal  Number of  Statistic  95% Critical Value  P-Value "
[2,] "    Components          lags                                           "
[3,] "_______________________________________________________________________"
[4,] "                                                                       "
[5,] "          2              3       5.73817         5.99146       0.05675 "
[6,] "          3              3       3.23316         7.81473       0.35704 "
[7,] "          4              3      13.12378         9.48773       0.01069 "
Example:
; We illustrate here the altenative use of the quantlet, in which the
; regressors are explicitely mentioned. As we choose as regressors
; x the two lagged realizations of y, as number of hidden units 10,
; and as number of principal components 2, the result is a particular
; case of the first example. As we did not include a constant in the
; regressors, this constant is automatically added as displayed
; in the warning message after the results.
library("times")   ; loads the library times
randomize(1)       ; sets the seed
y  = gentar(2,1,0,0.5|-0.5,normal(400))
x1 = y[3:400]; y
x2 = y[1:398]~y[2:399]      ; two lagged values of y
q  = annlintest(x1,x2,10,2)
q

Result:
Contents of q

[1,] "Number of Principal   Statistic  95% Critical Value  P-Value "
[2,] "    Components                                               "
[3,] "_____________________________________________________________"
[4,] "                                                             "
[5,] "         2            12.14334         5.99146       0.00231 "
[6,] "                                                             "
[7,] "A constant has been added to the matrix of regressors        "



Author: W. Haerdle, R. Schulz, G. Teyssiere 20021116 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006