We propose a new exact test for nonlinearity in a regression model wit
h one possibly nonlinear component. The test is based on the stochasti
c interpretation of spline smoothing given in Wahba (1978) and is a po
int optimal invariant test (as defined in King, 1988) based on this st
ochastic model. We show that the power of the exact test compares favo
urably with several other exact tests for nonlinearity proposed in the
literature, and that its level and power are robust to long- and shor
t-tailed symmetric error distributions. We also present an O(n) algori
thm based on a state space approach to compute exact p-values for the
point optimal invariant test, whereas previous implementations require
d O(n3) operations. An example is presented to illustrate the theory.