Performs the lack-of-fit test for a univariate time series or transfer function, given the appropriate correlation function.
TS_LACK_OF_FIT (timeseries_expression, p_value, q_value, lagmax, [tolerance])
OVER (window-spec)
This function returns a double-precision floating-point value containing the lack-of-fit statistic (q) for the time series. TS_LACK_OF_FIT calls the function imsls_d_lack_of_fit in the IMSL libraries.
The arguments of TS_LACK_OF_FIT map to the IMSL library function imsls_d_lack_of_fit as follows:
params = imsls_d_arma(n_objs, z[], p, q, IMSLS_LEAST_SQUARES, IMSLS_CONVERGENCE_TOLERANCE, tolerance, IMSL_RESIDUAL, &residual, 0);correlations = imsls_d_autocorrelation(n_objs-p+lagmax, residuals, lagmax, 0);result = imsls_d_lack_of_fit(n_objs, correlations, lagmax, npfree, 0);
For detailed information on how the IMSL function imsls_d_lack_of_fit performs time series calculations, see IMSL C Numerical Library User’s Guide: Volume 2 of 2 C Stat Library.
This example shows a SQL statement containing the TS_LACK_OF_FIT function and the data values returned by the function. This example uses the example input data table (called DATASET) as its input data.
select ts_lack_of_fit(data,1,1,5,0.225) over (order by rownum rows between unbounded preceding and unbounded following) as res from DATASET
Sybase IQ returns 50 rows, each containing the same value: