As an Chi-Square test is performed on two times the difference in
minimized smoothing parameter selection score (GCV, fREML, REML, ML),
and the difference in degrees of freedom specified in the model.
The degrees of freedom of the model terms are the sum of
1) the number of estimated smoothing parameters for the model,
2) number of parametric (non-smooth) model terms including the intercept,
and 3) the sum of the penalty null space dimensions of each smooth object.This method is preferred over other functions such as AIC
for
models that include an AR1 model or random effects (especially nonlinear
random smooths using bs="fs"
). CompareML also reports the AIC
difference, but that value should be treated with care.
Note that the Chi-Square test will result in a very low p-value
when the difference in degrees of freedom approaches zero. Use common sense
to determine if the difference between the two models is meaningful.
A warning is presented when the difference in score is smaller
than 5.
The order of the two models is not important.
Model comparison is only implemented for the methods GCV, fREML, REML, and ML.