# white.test

##### White Neural Network Test for Nonlinearity

Generically computes the White neural network test for neglected
nonlinearity either for the time series `x`

or the regression
`y~x`

.

- Keywords
- ts

##### Usage

```
# S3 method for ts
white.test(x, lag = 1, qstar = 2, q = 10, range = 4,
type = c("Chisq","F"), scale = TRUE, …)
# S3 method for default
white.test(x, y, qstar = 2, q = 10, range = 4,
type = c("Chisq","F"), scale = TRUE, …)
```

##### Arguments

- x
a numeric vector, matrix, or time series.

- y
a numeric vector.

- lag
an integer which specifies the model order in terms of lags.

- q
an integer representing the number of phantom hidden units used to compute the test statistic.

- qstar
the test is conducted using

`qstar`

principal components of the phantom hidden units. The first principal component is omitted since in most cases it appears to be collinear with the input vector of lagged variables. This strategy preserves power while still conserving degrees of freedom.- range
the input to hidden unit weights are initialized uniformly over [-range/2, range/2].

- type
a string indicating whether the Chi-Squared test or the F-test is computed. Valid types are

`"Chisq"`

and`"F"`

.- scale
a logical indicating whether the data should be scaled before computing the test statistic. The default arguments to

`scale`

are used.- …
further arguments to be passed from or to methods.

##### Details

The null is the hypotheses of linearity in ``mean''. This
type of test is consistent against arbitrary nonlinearity
in mean. If `type`

equals `"F"`

, then the F-statistic
instead of the Chi-Squared statistic is used in analogy to the
classical linear regression.

Missing values are not allowed.

##### Value

A list with class `"htest"`

containing the following components:

the value of the test statistic.

the p-value of the test.

a character string indicating what type of test was performed.

a list containing the additional parameters used to compute the test statistic.

a character string giving the name of the data.

additional arguments used to compute the test statistic.

##### References

T. H. Lee, H. White, and C. W. J. Granger (1993): Testing for
neglected nonlinearity in time series models. *Journal of
Econometrics* **56**, 269-290.

##### See Also

##### Examples

```
# NOT RUN {
n <- 1000
x <- runif(1000, -1, 1) # Non-linear in ``mean'' regression
y <- x^2 - x^3 + 0.1*rnorm(x)
white.test(x, y)
## Is the polynomial of order 2 misspecified?
white.test(cbind(x,x^2,x^3), y)
## Generate time series which is nonlinear in ``mean''
x[1] <- 0.0
for(i in (2:n)) {
x[i] <- 0.4*x[i-1] + tanh(x[i-1]) + rnorm(1, sd=0.5)
}
x <- as.ts(x)
plot(x)
white.test(x)
# }
```

*Documentation reproduced from package tseries, version 0.10-47, License: GPL-2*