Performs the lack-of-fit test for a univariate time series. This function is identical to TS_LACK_OF_FIT, except that TS_LACK_OF_FIT_P returns the p-value of q, rather than returning q.
TS_LACK_OF_FIT_P (timeseries_expression, p_value, q_value, lagmax, [tolerance])
OVER (window-spec)
This function returns a double-precision floating-point value containing the p-value of the lack-of-fit statistic (q) for the time series. TS_LACK_OF_FIT_P calls the function imsls_d_lack_of_fit in the IMSL libraries.
The arguments of TS_LACK_OF_FIT_P 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_P 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_p(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: