TS_LACK_OF_FIT Function [Aggregate]

Performs the lack-of-fit test for a univariate time series or transfer function, given the appropriate correlation function.

Syntax

TS_LACK_OF_FIT (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 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.

IMSL Mapping

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);

Example

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.

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

Values Returned from TS_LACK_OF_FIT

res

3.96751

3.96751

3.96751

3.96751

3.96751

3.96751

3.96751

3.96751

3.96751

3.96751

...

3.96751

Standards and Compatibility

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