x
or the regression
y~x
.## S3 method for class 'ts':
white.test(x, lag = 1, qstar = 2, q = 10, range = 4,
type = c("Chisq","F"), scale = TRUE, ...)
## S3 method for class 'default':
white.test(x, y, qstar = 2, q = 10, range = 4,
type = c("Chisq","F"), scale = TRUE, ...)
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 p"Chisq"
and "F"
.scale
are used."htest"
containing the following components: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.terasvirta.test
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)
Run the code above in your browser using DataLab