TS_LACK_OF_FIT_P Function [Aggregate]

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.

Syntax

TS_LACK_OF_FIT_P (timeseries_expression, p_value, q_value, lagmax, [tolerance])
OVER (window-spec)

Licensing Prerequisites

Available only with RAP – The Trading Edition Enterprise.

Parameters

Usage

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.

IMSL Mapping

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.

Example

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.

The following SQL statement returns the p value of the lack of fit statistic on data from the data column:
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:

Values Returned from TS_LACK_OF_FIT_P

res

0.735006

0.735006

0.735006

0.735006

0.735006

0.735006

0.735006

0.735006

0.735006

0.735006

...

0.735006

Standards and Compatibility

Related concepts
Aggregate Time Series Forecasting and Analysis Functions
Related reference
DATASET Example Input Data Table