The Performance of Ramsey Test , White Test and Terasvirta Test in Detecting Nonlinearity

Abstrak— The objective of this research is to compare Ramsey test, White test and Terasvirta test in the identification of nonlinearity. Ramsey test is a test based on the regression specification error test. While White test and Terasvirta test are based on neural network models. The difference between White test and Terasvirta test is in determining its weight, White test based on random sampling, while Terasvirta test based on Taylor expansion. Simulation studies are carried out with various scenarios in each test by generating linear models, linear models with outliers and nonlinear models. The results of the simulation study showed that Terasvirta test had better power than Ramsey test and White test in detecting nonlinearity. Terasvirta test is also more sensitive to the presence of outliers in linear models.


I. INTRODUCTION
Recently, models in statistics became more complex. The model used is not only linear model but also nonlinear model [1]. Nonlinearity in data is caused by several things, i.e. the nonlinear relationship between variables and the existence of outliers. The outlier can change the pattern of data [2] as a model initially a linear model then becomes an outlier, so that changes this model to a nonlinear model. Problems that often occur in determining a linear or nonlinear model are effective ways to do a nonlinear detection. Often a model is considered linear but in reality is a nonlinear model. So it is necessary to determine an effective test in determining nonlinearity.
Nonlinearity tests have been extensively developed such as Ramsey test [3], White test [4] and Terasvirta test [5]. Ramsey test is the most common and easy to use in detecting nonlinearity. While White test and Terasvirta test are tests that use a neural network model. From the three tests need to determine which test is the best in identifying nonlinearity.
There were many studies that use nonlinearity test in their research. Wang et al. [6] used Terasvirta test in the identification of nonlinearity in his research. Lacheheb et al. [7] used Ramsey test for identification of nonlinearity. In general, from the previous research there is rarely any research comparing the power of the nonlinearity test. Previous research comparing several nonlinearity tests is Ahn et al. [8] compared eight nonlinearity tests i.e. Bispectrum, Hinich's Bicorrelation, BDS, Engle, Keenan, Tsay, Mcleod-Li and Ramsey. It was found that Ramsey, Keenan and Tsay had stronger power than the others. Lee et al. [9] compared Bonferoni, Keenan, Tsay, Mcleod-Li, Bispectrum, BDS and White. Overall White test is better than other test.
In this research, several nonlinearity tests will be used i.e. Ramsey test, White test and Terasvirta test. Then the power test of each method will be compared, so the best test and the most sensitive test to identify nonlinearity is obtained. The rest of paper is organized as follows: Section 2 reviews the nonlinearity test i.e. Ramsey test, White test and Terasvirta test; Section 3 presents the design of study simulation; Section 4 presents the result of analysis and discussion; and Section 5 presents the conclusion of this study.

II. NONLINEARITY TEST A. Ramsey Test
Ramsey proposed a method called RESET (regression specification error test) [10]. Suppose there are 2 variables, the predictor variable (X) and the response variable (Y). So we get a linear regression model: where k is the number of additional predictors, n is the number of observations and p2 is the number of predictors in model (2).
4. If Fhit > F(α, k, n-p2) then reject H0. The hypothesis is as follows: H0 : Model 1 is suitable (Linear). H1 : Model 1 is not suitable (Nonlinear). Ramsey test is easy to use, it is one of advantages using Ramsey test. While the weakness is that it cannot determine the best alternative model.

B. White Test
White test is based on a neural network model [4]. In general, to see the relationship between two variables such as X and Y, regression can be used. For example the equation of the neural network model is as follows (the following model consists of 1 hidden layer and q neurons): White test can be tested using the chi-square distribution and F distribution. The procedure in White test with chi-square distribution is as follows: where m is the number of additional predictors, n is the number of observations and p is the number of initial model predictors. If Fhit > F(α, m, n-p-m-1) then reject H0.

C. Terasvirta Test
Terasvirta test is one of the nonlinear tests. This test is almost same as white test that is both using a neural network model. The difference is that in terravirta test the parameter values of the neural network model are based on taylor expansion [5] while the white test is randomly selected.
Here is an example of a nonlinear model:  is the weight of the neural network model from the input layer to the hidden layer for nonliner components, '  is the weight of the neural network model from the input layer to the output layer for linear components and  is a sigmoid activation function. This equation (6) can be written as: where 0 j  is the weight of the neural network model from the hidden layer to the output layer for nonlinear components. If the nonlinear component is 0 then the data has a linear relationship. So the hypothesis is as follow: or can be written : The value of neural network parameters in the Teravista test uses taylor expansion so that a new model is obtained: If the quadratic and cubic component terms are 0 then fail to reject H0, so we get a linear model. Terasvirta where m is the number of additional predictors, n is the number of observations and p is the number of initial model predictors. If Fhit > F(α, m, n-p-m-1) then reject H0.

III. METHODOLOGY
In this research a simulation study will be conducted. Simulation studies are conducted to compare the power between Ramsey test, White test and Terasvirta test in detecting nonlinearity in linear models, linear models with outliers and nonlinear models. replications will be carried out. Figure 1 is showed the scenarios for study simulation. The following is a complete explanation of the scenario for each nonlinearity test: a. Ramsey test, the Ramsey test will be tested on 3 types of power, i.e. 2 (quadratic), 3 (cubic) and 2: 3 (quadratic and cubic), and used 3 types of predictors i.e. regressor, fitted and princomp. So for each model will produce a total of 27 scenarios. b. White test and Terasvirta test, in these two tests will be tried 2 different types of test statistics, i.e. F and Chisquare test. So for each model will produce a total of 6 scenarios.

IV. RESULT AND DISCUSSION
A. Data on Simulation Study Results Figure 2 and Figure 3 below show an illustration of the result simulation study from data. Each response variable in each model is plotted with each predictor variable. Based on Figure 1 it can be seen that for model 1, the response variable (y1) has a fairly strong linear relationship with x2. Although there is no pattern of linear relationship with x1, but it can be said that model 1 is a linear model. In model 2, model 3 and model 4 it can be seen that the pattern of the relationship between each response variable and its predictors (x1 and x2) does not indicate a linear relationship. So model 2, model 3 and model 4 are nonlinear models.
Based on Figure 3, it can be seen that for the initial model (model 1) is a model that has a pattern of linear relationships between response variables and predictors. Then 1 outlier, 3 outlier and 5 outlier was added. Visually it appears that the data pattern is still linear, but it will be proven whether the existence of outliers changes linearity. This will be discussed in section 4.2.2.

B. Power Comparison for Each Nonlinearity Test
Simulation studies conducted on each model in each scenario replicated 10000 times. Three sample sizes are used: 50 to represent small samples, 100 to represent medium samples and 200 to represent large samples. After testing, power will be calculated for each test. This power is the number of conclusions reject H0 (the model is a nonlinear model) in 10000 times test in each model in each scenario. Determination of the value of this power is based on values with a significance level of 0.05.

Power Comparison Result for Each Nonlinearity Test in Linear Model and Nonlinear Model
From Figure 4 it can be seen that in general model 1 which is a linear model has power which approaches the level of significance 0.05. Model 2, model 3 and model 4 which are nonlinear models, the power value is close to 1. This does not only occur in the Ramsey test but also occurs in White test and Terasvirta test, it can be seen in Figure 5 and Figure 6. models In general, if the number of samples is used 100 power tests will tend to be very high. If the type of predictor used in the form of fitted power the test will generally be lower. Power is very dependent on the type of data used. For model 2 with power 2 the test power is low while for models 3 and 4 with power 2: 3 the test power is low.
Based on Figure 5 in general if the number of samples used as much as 100 power tests will tend to be very high. Whereas if the Chisq test is used it has a higher power test than if it uses the F test. Based on Figure 6, Terasvirta test power is not significantly influenced by the number of samples and statistics test. It can be seen in model 2, model 3 and model 4 the power is close to 1 for all scenarios. But from model 1 which is a linear model, using Chisq made the power of test will be higher.   Figure 4, Figure 5 and Figure 6 in detecting nonlinearity, Terasvirta test is the test that has the most powerful compared to Ramsey test and White test. For seeing the p-value consistency of each test at 10000 replications, it can use time series plots. From Figure 7 it can be seen that for model 1 using Ramsey test the results are consistent above 0.05, it meaning that the resulting model is a linear model. These results are almost the same for White test and Ramsey test, it can be seen in Figure 7 and Figure 8. In model 2, model 3 and model 4 using several scenarios there are some homogeneous p-values and some heterogeneous p-values. But for the heterogeneity scenario is no bigger than White test. Based on Figure 8, it is known that for the nonlinear model, model 2, model 3 and model 4, the p-value is not homogeneous. These results are quite different when compared to Ramsey test and Terasvirta test.
From Figure 9 it is known that for model 1 Figure 6. Terasvirta's power test for linear and nonlinear models       Based on Figure 11 in general the existence of 1, 3 and 5 outliers does not affect the linearity of the model based on White test. The power of this White test for all scenarios approaches the significance level of 0.05. In general based on Figure 12, it can be seen that Terasvirta test is more sensitive to the presence of outliers in the linear model when compared to Ramsey test and White test. This Terasvirta power test is not around the significance level 0.05 but it is around 0.1. From Figure 12, it can be seen if the Chisq test statistics used in the Terasvirta test will be more sensitive to outliers. It can also be seen in Table 3 and Table 4, where the power value of Terasvirta test is greater than other tests in detecting linear models with the addition of outliers.
Based on Figure 11 in general the existence of 1, 3 and 5 outliers does not affect the linearity of the model based on White test. The power of this White test for all scenarios approaches the significance level of 0.05. In general based on Figure 12, it can be seen that Terasvirta test is more sensitive to the presence of outliers in the linear model when compared to Ramsey test and White test. This Terasvirta power test is not around the significance level 0.05 but it is around 0.1. From Figure 12, it can be seen if the Chisq test statistics used in the Terasvirta test will be more sensitive to outliers. It can also be seen in Table 3 and Table 4, where the power value of Terasvirta test is greater than other tests in detecting linear models with the addition of outliers.
To see the p-value consistency of each test at 10000 replications, we can use the time series plot. From Figure  13, Figure 14 and Figure 15, it can be seen that with Ramsey test, White test and Terasvirta test with various scenarios in the linear model with outliers, the p-value is consistently above 0.05. This means that from the tests conducted in 10000 replications the results are consistent that the model is a linear model. In general, having a small number of outliers in a linear model does not change the linearity of the data.
In general, the results of research conducted indicate that Terasvirta test has greater power in the detection of nonlinearity than the other test. In a study conducted by Ahn et al. [8] showed that Ramsey test in general has better power in the detection of nonlinearity and from research conducted by Lee et al. [9] in general White test has better power. In this study the two nonlinearity tests that had the best power were Ramsey   It can be seen from the very high Terasvirta test power (close to 1) when detecting nonlinearity in nonlinear models. It can also be concluded that Terasvirta test is more sensitive to outliers (in detecting nonlinearity models). It can be seen from Terasvirta power test that higher compared to Ramsey test and White test. The results of this study also showed that White test tended to have lower power compared to Ramsey test and Terasvirta test. It happen because the weight selection in White test uses random sampling. So that in future studies another way to determine weight can be done, not just using random sampling. Besides that, in further research, other nonlinearity tests can be used such as RBF test [11] to be compared.