TS_ARMA_CONST Function [Aggregate]

Calculates the least-square estimates of parameters for an autoregressive moving average (ARMA) model, and returns an estimated constant.

Syntax

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

Licensing prerequisites

Available only with RAP – The Trading Edition Enterprise.

Parameters

Usage

This time series function returns a double-precision floating-point value containing the constant estimate produced by the function. TS_ARMA_CONST calls the function imsls_d_arma in the IMSL libraries.

IMSL mapping

The arguments of TS_ARMA_CONST map to the IMSL library function imsls_d_arma as follows:

params = imsls_d_arma(n_objs, z, p, q, IMSLS_CONSTANT, method_id, 0);

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

Example 1

This example shows a SQL statement containing the TS_ARMA_CONST 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 an estimated constant from the data column using the method of least squares:
SELECT TS_ARMA_CONST(data,0) 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_ARMA_CONST example 1

res

0.082077

0.082077

0.082077

0.082077

0.082077

0.082077

0.082077

0.082077

0.082077

...

0.082077

Example 2

This example provides a sample query that returns estimates for the AR, MA, and constant parameters. The first element for AR and MA in the array contains one element.
select ts_arma_ar(data,1,1,0) over (order by rownum rows between unbounded preceding and unbounded following) as ar_param, ts_arma_ma(data,1,1,0) over (order by rownum rows between unbounded preceding and unbounded following) as ma_param, ts_arma_const(data,0) over (order by rownum rows between unbounded preceding and unbounded following) as const_param FROM DATASET

Sybase IQ returns 50 rows of data, each containing the same three values:

Values returned from TS_ARMA_CONST example 2

ar_param

ma_param

const_param

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

0.898793

0.105075

0.082077

...

...

...

0.898793

0.105075

0.082077

Standards and compatibility

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