Calculates the exact maximum likelihood estimation of the
parameters in a univariate ARMA (autoregressive moving average)
time series model, and returns the requested autoregressive estimate.
Syntax
TS_MAX_ARMA_AR (timeseries_expression, ar_count, ar_elem)
OVER (window-spec)
Licensing Prerequisites
Available only with RAP – The Trading Edition Enterprise.
Parameters
- timeseries_expression – a numeric expression, generally a column name, containing
an element in a time series.
- ar_count – an integer containing the number of autoregressive values
to compute.
- ar_elem – an integer identifying which element in the computed autoregressive
array is to be returned. The integer must be greater than 0 and less
than or equal to ar_count.
- window-spec – TS_MAX_ARMA_AR is an OLAP function
requiring an OVER () clause.
Usage
This function returns a double-precision floating-point value
containing the autoregressive estimate. TS_MAX_ARMA_AR calls
the function imsls_d_max_arma in
the IMSL libraries.
IMSL Mapping
The arguments of TS_MAX_ARMA_AR map
to the IMSL library function imsls_d_max_arma as
follows:
params = imsls_d_max_arma(n_objs, z[], p, q, 0);
- n_objs – contains the number of rows in the current window frame.
- z[] – contains the value of timeseries_expression for the
current window frame.
- p – maps to the ar_count argument.
- q – =1.
For detailed information on how the IMSL function imsls_d_max_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_MAX_ARMA_AR 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 second element from
an array containing two autoregressive estimates of data from the
data column:
select ts_max_arma_ar(data,2,2) 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_MAX_ARMA_AR Example 1
res
|
0.179748
|
0.179748
|
0.179748
|
0.179748
|
0.179748
|
0.179748
|
0.179748
|
0.179748
|
0.179748
|
0.179748
|
...
|
0.179748
|
Example 2
This example provides a sample query that returns two columns
of results from the DATASET table—the first and second
elements of the autoregressive estimates.
select ts_max_arma_ar(data,2,1) over (order by rownum rows between unbounded preceding and unbounded following) as ar_elem1, ts_max_arma_ar(data,2,2) over (order by rownum rows between unbounded preceding and unbounded following) as ar_elem2 FROM DATASET
Sybase IQ returns 50 rows of data, each containing the same
two values:
Values Returned from TS_MAX_ARMA_AR Example 2
ar_elem1
|
ar_elem2
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
0.731164
|
0.179748
|
...
|
...
|
0.731164
|
0.179748
|
Standards and compatibility
- SQL – ISO/ANSI SQL compliant
- Sybase – not compatible with SQL Anywhere or Adaptive Server EnterpriseRAP – The Trading Edition Enterprise