stl#

swordfish.function.stl()#

Use Loess method to decompose a time series into trend, seasonality and randomness. The result is a dictionary with the following keys: trend, seasonal, and residual. Each key corresponds to a vector with the same length as data.

Parameters:
  • data (Constant) – A numeric vector.

  • period (Constant) – Ainteger larger than 1 indicating the length of a time-series cycle.

  • sWindow (Constant) – Either the string “periodic” that means smoothing is effectively replaced by taking the mean, or an odd number no smaller than 7 indicating the span (in lags) of the loess window for seasonal extraction.

  • sDegree (Constant, optional) – Can be 0, 1 or 2 indicating the degree of locally-fitted polynomial in seasonal extraction, by default DFLT

  • sJump (Constant, optional) – An integer greater than 1 indicating the number of elements to skip for the smoother in seasonal extraction, by default DFLT.

  • tWindow (Constant, optional) – A positive odd number indicating the span (in lags) of the loess window for trend extraction, by default DFLT.

  • tDegree (Constant, optional) – Can be 0, 1 or 2 indicating the degree of locally-fitted polynomial in trend extraction, by default DFLT.

  • tJump (Constant, optional) – An integer greater than 1 indicating the number of elements to skip for the smoother in trend extraction, by default DFLT

  • lWindow (Constant, optional) – A positive odd number indicating the the span (in lags) of the loess window of the low-pass filter used for each subseries, by default DFLT.

  • lDegree (Constant, optional) – Can be 0, 1 or 2 indicating the degree of locally-fitted polynomial for the subseries low-pass filter, by default DFLT.

  • lJump (Constant, optional) – An integer greater than 1 indicating the number of elements to skip for the smoother in the subseries low-pass filter, by default DFLT.

  • robust (Constant, optional) – A Boolean value indicating if robust fitting is used in the loess procedure, by default DFLT

  • inner (Constant, optional) – A positive integer indicating the number of ‘inner’ (backfitting) iterations; usually very few (2) iterations suffice, by default DFLT.

  • outer (Constant, optional) – A positive integer indicating the number of ‘outer’ robustness iterations, by default DFLT.