Calculates the sample partial autocorrelation function of
a stationary time series.
Syntax
TS_PARTIAL_AUTOCORRELATION (timeseries_expression, lagmax, lag_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.
- lagmax – an integer containing the maximum lag of autocovariance, autocorrelations,
and standard errors of autocorrelations to be calculated. The integer
must be greater than or equal to 1, and less than the number of
elements in the time series.
- lag_elem – an integer identifying the element in the autocorrelation
array to return. The integer must be greater than 0 and less than
or equal to lagmax.
- window-spec – TS_PARTIAL_AUTOCORRELATION is an OLAP function requiring
an OVER () clause.
Usage
This function returns an outlier-free time series. TS_PARTIAL_AUTOCORRELATION calls
the function imsls_d_autocorrelation and imsls_d_partial_autocorrelation in
the IMSL libraries.
IMSL Mapping
The arguments of TS_PARTIAL_AUTOCORRELATION map
to the IMSL library functions imsls_d_autocorrelation and imsls_d_partial_autocorrelation as follows:
params = imsls_d_autocorrelation(n_objs, z[], lagmax, 0);
result = imsls_d_partial_autocorrelation(lagmax, params, 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.
- lagmax – maps to the TS_PARTIAL_AUTOCORRELATION argument lagmax.
For detailed information on how the IMSL functions imsls_d_autocorrelation and imsls_d_partial_autocorrelation perform
time series calculations, see IMSL C Numerical Library User’s Guide: Volume 2 of 2 C Stat Library.
Example
This example shows SQL statement containing
the TS_PARTIAL_AUTOCORRELATION 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 first element from
an array containing partial autocorrelations of data from the
data column:
select ts_partial_autocorrelation(data,1,1) 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_PARTIAL_AUTOCORRELATION
res
|
0.883453
|
0.883453
|
0.883453
|
0.883453
|
0.883453
|
0.883453
|
0.883453
|
0.883453
|
0.883453
|
0.883453
|
...
|
0.883453
|
Standards and Compatibility
- SQL – ISO/ANSI SQL compliant
- Sybase – not compatible with SQL Anywhere or Adaptive Server Enterprise