tidiers_stl | R Documentation |
Tidying methods for STL (Seasonal, Trend, Level) decomposition of time series
## S3 method for class 'stl'
sw_tidy(x, ...)
## S3 method for class 'stl'
sw_tidy_decomp(x, timetk_idx = FALSE, rename_index = "index", ...)
## S3 method for class 'stlm'
sw_tidy_decomp(x, timetk_idx = FALSE, rename_index = "index", ...)
## S3 method for class 'stlm'
sw_glance(x, ...)
## S3 method for class 'stlm'
sw_augment(x, data = NULL, rename_index = "index", timetk_idx = FALSE, ...)
x |
An object of class "stl" |
... |
Not used. |
timetk_idx |
Used with |
rename_index |
Used with |
data |
Used with |
sw_tidy()
wraps sw_tidy_decomp()
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
season
: The seasonal component
trend
: The trend component
remainder
: observed - (season + trend)
seasadj
: observed - season (or trend + remainder)
sw_glance()
returns the underlying ETS or ARIMA model's sw_glance()
results 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
stl()
library(dplyr)
library(forecast)
library(sweep)
fit_stl <- USAccDeaths %>%
stl(s.window = "periodic")
sw_tidy_decomp(fit_stl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.