Learn R Programming

stR

The goal of stR is to provide two methods for decomposing seasonal data: STR (a Seasonal-Trend decomposition procedure based on Regression) and Robust STR. In some ways, STR is similar to Ridge Regression and Robust STR can be related to LASSO. They allow for multiple seasonal components, multiple linear covariates with constant, flexible and seasonal influence. Seasonal patterns (for both seasonal components and seasonal covariates) can be fractional and flexible over time; moreover they 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.

Installation

You can install the release version from CRAN.

install.packages('stR')

You can install the development version from GitHub.

# install.packages("remotes")
devtools::install_github("robjhyndman/stR")

Example

For most users, the AutoSTR() function will be the preferred way of using the package.

library(stR)
# Decomposition of a multiple seasonal time series
decomp <- AutoSTR(calls)
plot(decomp)

# Decomposition of a monthly time series
decomp <- AutoSTR(log(grocery))
plot(decomp)

See the vignette for more advanced options.

Copy Link

Version

Install

install.packages('stR')

Monthly Downloads

904

Version

0.7

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Rob Hyndman

Last Published

July 28th, 2024

Functions in stR (0.7)

pattern

Common argument
plotBeta

Plots the varying beta coefficients of decomposition
plot.STR

Plots the results of decomposition
heuristicSTR

Automatic STR decomposition with heuristic search of the parameters
gapCV

Common argument
predictors

Common argument
grocery

Grocery and supermarkets turnover
nFold

Common argument
nMCIter

Common argument
strDesign

Common argument
reexports

Objects exported from other packages
trace

Common argument
solver

Common argument
lambdas

Common argument
seasadj.STR

Seasonal adjustment based on STR
robust

Common argument
reltol

Common argument
reportDimensionsOnly

Common argument
control

Common argument
AutoSTR

Automatic STR decomposition for time series data
STR

Automatic STR decomposition
components

Extract STR components
RSTRmodel

Robust STR decomposition
STRmodel

STR decomposition
calls

Number of phone calls dataset
data

Common argument
confidence

Common argument
electricity

Electricity consumption dataset