decompose_stl() splits a series into trend, seasonal pattern and
remainder by LOESS (Cleveland, Cleveland, McRae & Terpenning, 1990);
its defaults are those of stats::stl() and, without robust, so are its
numbers (with robust = TRUE the two agree up to the eleventh robustness
round and drift apart in the third digit after that).
decompose_mstl() applies STL in turn to each of several seasonal periods
(Bandara, Hyndman & Bergmeir, 2021).
Usage
decompose_stl(
y,
period = NULL,
seasonal_window = NULL,
trend_window = NULL,
low_pass_window = NULL,
degrees = NULL,
robust = FALSE,
inner = NULL,
outer = NULL
)
decompose_mstl(
y,
periods = NULL,
windows = NULL,
iterations = NULL,
robust = FALSE
)Arguments
- y
A
tsor a numeric vector, longer than two full cycles.- period
The seasonal period, when
yis a plain vector.- seasonal_window
The LOESS window over the cycles, an odd number, usually 7 or more (an even number is taken as the next odd one): the smaller, the faster the pattern may change.
NULLkeeps the same pattern in every cycle (s.window = "periodic").- trend_window, low_pass_window
LOESS windows of the trend and of the low-pass filter.
- degrees
LOESS degrees (0 or 1) of the seasonal, trend and low-pass smoothers; default
c(0, 1, 1).- robust
Down-weight outliers.
- inner, outer
Passes of the inner loop and robustness rounds.
- periods
Seasonal periods.
- windows
Seasonal windows, one per period in increasing order of period (default 11, 15, 19, ...).
- iterations
Rounds over the periods (default 2).
