STLESDTEST
outlier
gts
The 'STLESDTEST' function detects outliers in a Geo Time Series™ (or a LIST of Geo Time Series™) which has a seasonal part.
The seasonal part and the trend part of the Geo Time Series™ are extracted using STL
decomposition, then an ESDTEST
is performed on the remainder.
This function only applies to bucketized GTS of type DOUBLE.
References
Cleveland, Robert B., et al. "STL: A seasonal-trend decomposition procedure based on loess." Journal of Official Statistics 6.1 (1990): 3-73.
Rosner, Bernard (May 1983), "Percentage Points for a Generalized ESD Many-Outlier Procedure",Technometrics, 25(2), pp. 165-172.
STLESDTEST is available since version 1.0.0.
See also
Signatures
Examples
// Macro used to generate an approximately normal distribution (using central limit theorem)
<% RAND RAND RAND RAND RAND RAND + + + + + 3.0 - %> 'normal' STORE
// we generate a GTS with an approximately normal distribution
[ NEWGTS 1 50 <% NaN NaN NaN @normal ADDVALUE %> FOR
// we add outliers (> 3.0 in absolute value)
// Note that we do this before adding seasonal and trend components
25 NaN NaN NaN -3.9 ADDVALUE
36 NaN NaN NaN 3.8 ADDVALUE
DEDUP
// we generate a periodic GTS of mean 0
NEWGTS 1 50 <% NaN NaN NaN 4 PICK 10 % 4.5 - ADDVALUE %> FOR
// we generate a trend GTS (linear raise y=x)
NEWGTS 1 50 <% NaN NaN NaN 4 PICK ADDVALUE %> FOR ]
// we sum up the 3 components: remainder, seasonal and trend
[ SWAP [] reducer.sum ] REDUCE 'sum' RENAME
// bucketize
[ SWAP bucketizer.first 0 1 50 ] BUCKETIZE 0 GET
// we call STLESDTEST
10 2 STLESDTEST