TS_ESTIMATE_MISSING Function [Aggregate]

Estimates the missing values in a time series and returns them as a new time series, interspersed with the original time series.

Syntax

TS_ESTIMATE_MISSING (timeseries_expression, method)
OVER (window-spec)

Licensing prerequisites

Available only with RAP – The Trading Edition Enterprise.

Parameters

Usage

Use TS_ESTIMATE_MISSING to estimate any missing equidistant time points using one of the four estimation methods. TS_ESTIMATE_MISSING calls the function imsls_d_estimate_missing in the IMSL libraries

You cannot use TS_ESTIMATE_MISSING if more than two consecutive NULL values exist in your set of timepoints. If the first or last two values in the set of timepoints are NULL, the function returns NULL.

IMSL mapping

The arguments of TS_ESTIMATE_MISSING map to the IMSL library function imsls_d_estimate_missing as follows:

params = imsls_d_estimate_missing(n_objs, tpoints[], z[], method, 0);

For detailed information on how the function imsls_d_estimate_missing performs time series calculations, see IMSL C Numerical Library User’s Guide: Volume 2 of 2 C Stat Library.

Example

This example shows an input data table, a SQL statement containing the TS_ESTIMATE_MISSING function, and the data values returned by the function. This example uses the following table (called EST_MISSING_DATASET) as its input data. The EST_MISSING_DATASET table contains nine rows of time series data:

Input data table EST_MISSING_DATASET

rownum

data

1

2.8223

2

-0.5721

3

2.2771

4

NULL

5

1.2648

6

1.0278

7

0.6991

8

-1.7539

9

-2.8875

The following SQL statement estimates the value of the data missing from the fourth row:
SELECT ts_estimate_missing(data,0) OVER (order by rownum rows between unbounded preceding and unbounded following) AS res FROM EST_MISSING_DATASET

Sybase IQ returns the following nine rows, replacing the NULL value with 1.0278:

Values returned from TS_ESTIMATE_MISSING

res

2.8223

-0.5721

2.2771

1.0278

1.2648

1.0278

0.6991

-1.7539

-2.8875

Standards and compatibility

See also

System Administration Guide: Volume 2 > Using OLAP

IMSL C Numerical Library User’s Guide: Volume 2 of 2 C Stat Library