The goal of stR is to provide two methods for decomposing seasonaldata: STR (a Seasonal-Trend decomposition procedure based on Regression)and Robust STR. In some ways, STR is similar to Ridge Regression andRobust STR can be related to LASSO. They allow for multiple seasonalcomponents, multiple linear covariates with constant, flexible andseasonal influence. Seasonal patterns (for both seasonal components andseasonal covariates) can be fractional and flexible over time; moreoverthey can be either strictly periodic or have a more complex topology.The methods provide confidence intervals for the estimated components.The methods can also be used for forecasting.
You can install therelease version from CRAN.
install.packages('stR')You can install thedevelopment version fromGitHub.
# install.packages("remotes")devtools::install_github("robjhyndman/stR")For most users, theAutoSTR() function will be thepreferred way of using the package.
library(stR)# Decomposition of a multiple seasonal time seriesdecomp<-AutoSTR(calls)plot(decomp)
# Decomposition of a monthly time seriesdecomp<-AutoSTR(log(grocery))plot(decomp)
See the vignette for more advanced options.