Perform classical time series decomposition.
decomp(
y,
m = NULL,
s = NULL,
trend = NULL,
outplot = c(FALSE, TRUE),
decomposition = c("multiplicative", "additive", "auto"),
h = 0,
type = c("mean", "median", "pure.seasonal"),
w = NULL
)A list containing:
trend: trend component.
season: season component.
irregular: irregular component.
f.season: forecasted seasonal component if h>0.
g: pure seasonal model parameters.
input time series. Can be ts object.
seasonal period. If y is a ts object then the default is its frequency.
starting period in the season. If y is a ts object then this is picked up from y.
vector of the level/trend of y. Use NULL to estimate internally.
if TRUE, then provide a plot of the decomposed components.
type of decomposition. This can be "multiplicative", "additive" or "auto". If y contains non-positive values then this is forced to "additive".
forecast horizon for seasonal component.
calculation for seasonal component:
"mean": the mean of each seasonal period.
"median": the median of each seasonal period.
"pure.seasonal": estimate using a pure seasonal model.
percentage or number of observations to winsorise in the calculation of mean seasonal indices. If w>1 then it is the number of observations, otherwise it is a percentage. If type != "mean" then this is ignored.
Nikolaos Kourentzes, nikolaos@kourentzes.com.
Ord K., Fildes R., Kourentzes N. (2017) Principles of Business Forecasting, 2e. Wessex Press Publishing Co., p.106-111.