nonlinearityTest function

Nonlinearity test