Loading

STL


gts bucketize
Since v1.0.0
Available on all platforms
See also

The STL function applies a Seasonal Trend decomposition on a Geo Time Series™ or a LIST of Geo Time Series™, which is based on multiple calls of RLOWESS.

These Geo Time Series™ are the seasonal part and the trend part of the input Geo Time Series™. Their classnames are suffixed with "_seasonal" and "_trend".

This function can only be applied to bucketized Geo Time Series™ of numeric type.

The MAP parameter must have at least the field PERIOD. You can provide additional optional parameters :

Optional parameters

Global

  • ROBUST if TRUE, set defaults of number of inner and outer loops to 1 and 15 instead of 2 and 0. Default is FALSE
  • PRECISION number of inner loops (a LONG). Default is 2 or 1
  • ROBUSTNESS number of outer loops (a LONG). Default is 0 or 15

Seasonal extract

  • BANDWIDTH_S the bandwidth (a LONG) of the local regression. Default is 7
  • DEGREE_S the degree (a LONG) of the polynomial fit. Default is 2
  • SPEED_S the number of values interpolated instead of estimated. Default is BANDWIDTH_S/10

Low frequency filtering

  • BANDWIDTH_L the bandwidth (a LONG) of the local regression. Default is nextOdd(PERIOD)
  • DEGREE_L the degree (a LONG) of the polynomial fit. Default is 1
  • SPEED_L the number of values interpolated instead of estimated. Default is BANDWIDTH_L/10

Trend extract

  • BANDWIDTH_T the bandwidth (a LONG) of the local regression. Default is nextOdd(ceiling(1.5*PERIOD/(1-(1.5/BANDWIDTH_S))))
  • DEGREE_T the degree (a LONG) of the polynomial fit. Default is 1
  • SPEED_T the number of values interpolated instead of estimated. Default is BANDWIDTH_T/10

Post seasonal smoothing

  • BANDWIDTH_P the bandwidth (a LONG) of the local regression. Default is 0 (i.e. no post smoothing)
  • DEGREE_P the degree (a LONG) of the polynomial fit. Default is 2
  • SPEED_P the number of values interpolated instead of estimated. Default is BANDWIDTH_P/10

Additional fields

  • BANDWIDT value of all BANDWIDTH_X fields that are not set
  • DEGREE value of all DEGREE_X fields that are not set
  • SPEED value of all SPEED_X fields that are not set

REFERENCE

Cleveland, Robert B., et al. "STL: A seasonal-trend decomposition procedure based on loess." Journal of Official Statistics 6.1 (1990): 3-73.

Signature

Examples

// generate periodic GTS of mean 0 [ NEWGTS 1 20 <% NaN NaN NaN 4 PICK 10 % 4.5 - ADDVALUE %> FOR // generate trend GTS (linear raise y=x) NEWGTS 1 20 <% NaN NaN NaN 4 PICK ADDVALUE %> FOR ] // sum up [ SWAP [] reducer.sum ] REDUCE 'sum' RENAME // bucketize [ SWAP bucketizer.first 0 1 20 ] BUCKETIZE 0 GET // call STL { 'PERIOD' 10 } STL