TS_AUTO_ARIMA_OUTLIER Function [Aggregate]

TS_AUTO_ARIMA_OUTLIER accepts an input time series and automatically determines the parameters of a multiplicative seasonal autoregressive integrated moving average (ARIMA) model. Whereas TS_AUTO_ARIMA uses the ARIMA model to forecast values beyond the set of inputs,TS_AUTO_ARIMA_OUTLIER uses the ARIMA model to identify statistical outliers in the input time series, and returns the outlier type of each one.

Syntax

TS_AUTO_ARIMA_OUTLIER( <time_value>, <timeseries_expression>              [ , <max_lag> [ , <critical	>              [ , <epsilon> [ , <criterion>              [ , <confidence> [, <model> [ , <delta>]]]]]]] )
OVER (window-spec)

Licensing Prerequisites

Available only with RAP – The Trading Edition Enterprise.

Parameters

Usage

The inputs to TS_AUTO_ARIMA and TS_AUTO_ARIMA_OUTLIER are nearly identical. However, TS_AUTO_ARIMA_OUTLIER returns different values for each input row within a partition, while TS_AUTO_ARIMA returns the same value for every row. Because of these differences in result data type and result value scoping, you need not use SELECT FIRST or SELECT DISTINCT to eliminate the duplicate output values. TS_AUTO_ARIMA_OUTLIER does not have any supporting scalar functions for decoding results.

Like TS_AUTO_ARIMA, TS_AUTO_ARIMA_OUTLIER requires the TS_INT_ARRAY supporting scalar function. TS_INT_ARRAY provides the binary composite input.

The function returns an integer value for each input tuple, specifying the type of outlier for the time and data value within each tuple. If the time and data value is not an outlier, the function returns NULL. The integer values are:

See IMSL C Numerical Library User’s Guide: Volume 2 of 2 C Stat Library for detailed information on the five outlier types.

IMSL Mapping

Maps to the outlier identification logic of imsls_d_auto_arima.

Example

This example computes the ARIMA model for the time series of the stock prices for XYZ, and then uses that model to identify which of the trades are statistical outliers. For rows which are not identified as outliers, TS_AUTO_ARIMA_OUTLIER returns NULL. For rows which are identified as outliers, TS_AUTO_ARIMA_OUTLIER returns an integer value between 0 and 4 representing the specific type of outlier for the current row.

select stock_trade_time,
	stock_price,
	stock_trade_shares,
	TS_AUTO_ARIMA_OUTLIER(stock_trade_time,
	stock_price) 
		over (order by stock_trade_time) as outlier_type
from stock_trades
where stock_symbol = 'XYZ'

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

Related reference
TS_INT_ARRAY Function [Scalar]
TS_AUTO_ARIMA Function [Aggregate]