Automatic Time Series Modeling Package

OUTLIER Methods

OUTLIER.Initialize Method

  • rc=obj.Initialize (TSDFObject);

Initializes an OUTLIER instance and specifies the time series data for the OUTLIER instance. The instance detects outliers in the time series of the dependent variable that you specify by using the TSDF.AddY method in the TSDFObject.

Input Arguments

You must specify the following input argument:

TSDFObject

specifies the TSDF object that holds the time series data to be used by the OUTLIER instance. This method retains only a reference to the TSDF object’s time series data frame and does not make a deep copy of its time series data.

OUTLIER.SetOption Method

  • rc=obj.SetOption ('Name', Value <,'Name', Value,…>);

Specifies named options for the OUTLIER instance.

Input Arguments

You must specify the following 'Name' and its associated Value:

'METHOD'

takes a string Value that specifies the method to be used by the OUTLIER object. You can specify one of the following Values:

ARIMA

specifies the ARIMA-based method. This is the default method. For this method, the OUTLIER object detects outliers by using the values of the dependent series after removing leading and trailing missing values.

HAMPEL

specifies the Hampel-based method. For this method, the OUTLIER object detects outliers by using the raw values of the dependent time series, which means that it keeps each missing value as-is while detecting outliers. The result is that missing values can be detected as outliers.

OUTLIER.AddFrom Method

  • rc=obj.AddFrom (ARIMASPECObject);

Adds a custom ARIMA model from a source instance into the OUTLIER object’s ARIMA model list. You can add one or more custom ARIMA models to an OUTLIER instance. If you call the AddFrom() method more than once, multiple custom ARIMA models are produced by collecting all the models from all the AddFrom() calls. The ARIMASPEC object that you specify must not contain any transfer functions. For more information, see the section Specifying ARIMA Models.

Input Arguments

You must specify the following input argument:

ARIMASPECObject

specifies the ARIMASPEC object instance that is supported by the TSM package.

OUTLIER.SetArima Method

  • rc=obj.SetArima (<'Name', Value,'Name',Value,…>);

Specifies named options for the 'ARIMA' method of the OUTLIER instance.

Input Arguments

You can specify one or more of the following 'Names' and the associated Value:

'ALLOWAO'

takes a Boolean Value that indicates whether to detect additive outliers. When you set this option to 1, additive outlier detection is enabled. Otherwise, detection is disabled. The default value is 1.

'ALLOWLS'

takes a Boolean Value that indicates whether to detect level shift outliers. When you set this option to 1, level shift outlier detection is enabled. Otherwise, detection is disabled. The default value is 1.

'ALLOWTLS'

takes a Boolean Value that indicates whether to detect temporary level shift outliers. When you set this option to 1, temporary level shift outlier detection is enabled. Otherwise, detection is disabled. You can use the 'TLSVALS' option to specify the valid durations of temporary level shifts that should be detected. The default value is 0.

'CRITERION'

takes a string Value that specifies the model selection criterion (statistic of fit) for selecting from among several candidate models. The default value is RMSE. For a list of valid values, see the 'CRITERION' argument in the DIAGNOSE.SetOption Method.

'MAXNUM'

takes a nonnegative integer Value that specifies the maximum number of outliers to include in a model. The default value is 2.

'MAXPCT'

takes a numeric Value between 0 and 100 that specifies the maximum number of outliers to include in a model as a percentage of the length of the dependent time series. If you set the values of 'MAXNUM' and 'MAXPCT' to 5 and 10, respectively, the maximum number of outliers is min left-parenthesis 5 comma 0.1 upper T right-parenthesis, where T is the length of the dependent time series after the beginning and ending missing values are removed. The default is a missing value.

'MODEL'

takes a Value a string array that specifies the names of candidate ARIMA models to be fitted for the outlier detection. For more information, see the section Specifying ARIMA Models.

'SIGLEVEL'

takes a numeric Value between 0 and 1 that specifies the cutoff value for outlier detection.

'TLSVALS'

takes a Value a numeric array that specifies the valid durations of any detected temporary level shifts. The duration of a temporary level shift should be greater than or equal to 2. An empty array or missing values in the array are not allowed. This option is ignored when you set the 'ALLOWTLS' option to 0 (default). If you omit the 'TLSVALS' option, then the detection of temporary level shift outliers is automatically disabled. The default is a missing value.

'USEBEST'

takes a numeric Value that indicates which type of the best model is selected for outlier detection. You can specify one of the following Values:

0

fits each ARIMA candidate, and detects and reports outliers for all candidates that are fitted successfully.

1

fits each ARIMA model candidate and chooses the best ARIMA model from all successful candidates according to the metric that you specify in the 'CRITERION' option. The OUTLIER object detects and reports outliers only for the best ARIMA model.

2

fits each ARIMA candidate and chooses the best ARIMA model from all successful candidates according to the average benefit of adding outliers. The model that has the best average benefit is deemed the best model, and outliers are reported only for that model.

The default value is 1. For more information, see the section 'USEBEST' Option for the ARIMA Method.

OUTLIER.SetHampel Method

  • rc=obj.SetHampel (<'Name', Value,'Name',Value,…>);

Specifies named options for the 'HAMPEL' method of the OUTLIER instance.

Input Arguments

You can specify one or more of the following 'Names' and the associated Value:

'DISTRIBUTION'

takes a string Value that specifies the data distribution that the OUTLIER object uses to compute the threshold for detecting outliers. You can specify the following distribution Values:

EXP

specifies an exponential distribution.

LAPLACE

specifies a Laplace distribution.

LOGISTIC

specifies a logistic distribution.

NORM

specifies a normal distribution. This is the default distribution.

UNIFORM

specifies a uniform distribution.

'NUMSTD'

takes a positive numeric Value that specifies the number of standard deviations. The OUTLIER object computes the outlier detection threshold by multiplying this Value by a scaling factor that corresponds to the distribution that you specify in the 'DISTRIBUTION' option. The default value is 3.

'THRESHOLD'

takes a positive numeric Value that specifies the threshold for detecting outliers. If you specify this option, then the 'NUMSTD' and 'DISTRIBUTION' options are ignored.

'WIDTH'

specifies a positive integer Value that determines the number of input observations to include in the sample window for outlier detection. If Value is equal to k, then a window of a maximum size of 2 dot k plus 1 is centered around each point of the time series, and outliers are detected by using the data in that window. The default value is 3.

OUTLIER.Run Method

  • rc=obj.Run ();

Runs outlier detection for the time series data frame that is specified for the OUTLIER instance.

Input Arguments

There are no arguments associated with this method.

OUTLIER.SetArimaEst Method

  • rc=obj.SetArimaEst (<'Name', Value,'Name',Value,…>);

Specifies named options that control the estimation process of the candidate ARIMA models that you add to the OUTLIER instance.

Input Arguments

You can specify one or more of the following 'Names': 'CONVERGE', 'DELTA', 'MAXITER', 'METHOD', 'NOSTABLE', 'SINGULAR'. For the description of the Value that is associated with each of these Names, see the section ARIMASPEC.SetOption Method.

Last updated: June 04, 2026