Tidying methods for ETS (Error, Trend, Seasonal) exponential smoothing modeling of time series
# S3 method for ets
sw_tidy(x, ...)# S3 method for ets
sw_glance(x, ...)
# S3 method for ets
sw_augment(x, data = NULL, timetk_idx = FALSE, rename_index = "index", ...)
# S3 method for ets
sw_tidy_decomp(x, timetk_idx = FALSE, rename_index = "index", ...)
sw_tidy() returns one row for each model parameter,
with two columns:
term: The smoothing parameters (alpha, gamma) and the initial states
(l, s0 through s10)
estimate: The estimated parameter value
sw_glance() returns one row with the columns
model.desc: A description of the model including the
three integer components (p, d, q) are the AR order,
the degree of differencing, and the MA order.
sigma: The square root of the estimated residual variance
logLik: The data's log-likelihood under the model
AIC: The Akaike Information Criterion
BIC: The Bayesian Information Criterion
ME: Mean error
RMSE: Root mean squared error
MAE: Mean absolute error
MPE: Mean percentage error
MAPE: Mean absolute percentage error
MASE: Mean absolute scaled error
ACF1: Autocorrelation of errors at lag 1
sw_augment() returns a tibble with the following time series attributes:
index: An index is either attempted to be extracted from the model or
a sequential index is created for plotting purposes
.actual: The original time series
.fitted: The fitted values from the model
.resid: The residual values from the model
sw_tidy_decomp() returns a tibble with the following time series attributes:
index: An index is either attempted to be extracted from the model or
a sequential index is created for plotting purposes
observed: The original time series
level: The level component
slope: The slope component (Not always present)
season: The seasonal component (Not always present)
An object of class "ets"
Not used.
Used with sw_augment only.
NULL by default which simply returns augmented columns only.
User can supply the original data, which returns the data + augmented columns.
Used with sw_augment and sw_tidy_decomp.
When TRUE, uses a timetk index (irregular, typically date or datetime) if present.
Used with sw_augment and sw_tidy_decomp.
A string representing the name of the index generated.
ets()
library(dplyr)
library(forecast)
library(sweep)
fit_ets <- WWWusage %>%
ets()
sw_tidy(fit_ets)
sw_glance(fit_ets)
sw_augment(fit_ets)
sw_tidy_decomp(fit_ets)
Run the code above in your browser using DataLab