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

Macro: annlintest
Description: This macro 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 we regress the residuals of a linear regression on the regressors of this regression and the principal components of a nonlinear transformation of the regressors. The first argument of the macro is the series y. The second argument is either 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. The macro adds automatically a constant if the constant term is missing in X. If the series is regressed on its past realizations, then the second argument, i.e., the number of lags, may be a vector. In that case, the corresponding linear models and statistics for neglected nonlinearity are computed. The third optional argument is the number of hidden units of the neural network, which should be greater than or equal to 3. The fourth optional argument is the number of principal components used in the auxiliary regression. The number of principal components should be less than the number of corresponding hidden units. The default third argument is the vector (10,20), the default fourth argument is the vector (2,3). If the series is regressed on a set of exogeneous variables X, the macro returns the number of principal components used in the auxiliary regression, the value of the test, the 95% critical value for the null hypothesis of the test, and the P value of the test. If the series is regressed on its past realizations, the number of lagged explanatory variables is also displayed.

Reference(s):

Usage: q = annlintest (y, x{, units{, principal_components}})
Input:
y n dimensional vector
x n x p matrix
order matrix
Output:
q vector of strings

Example:
;We calculate here the test for neglected nonlinearity. As the  
;second argument is equal to two, the series is regressed on its 
;two lagged values. Since there is no third and fourth argument,
;the number of hiden 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)  
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      11.78424         5.97378       0.00276 
[6,]           3              2       6.51763         7.80251       0.08897 
Example:
;We calculate here the test, where y is regressed on its 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") 
randomize(1)  ; 
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.77143         5.97378       0.05582 
[6,]           3              3      10.68780         7.80251       0.01354 
[7,]           4              3       9.20524         9.47844       0.05617 
Example:
;We illustrate here the other use of the macro, in which the 
;regressors are explicitely mentionned. 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") 
randomize(1)  ; 
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            11.78424         5.97378       0.00276 
[6,]  
[7,] A constant has been added to the matrix of regressors         

Library: times
See also: annarchtest

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

Author: Gilles Teyssiere, 980614
(C) MD*TECH Method and Data Technologies, 28.6.1999