Decomposes a Level Shifted Time Series

Explains the behavior of a time series by decomposing it into its trend, seasonality and residuals. It is built to perform very well in the presence of significant level shifts. It is designed to play well with any breakpoint algorithm and any smoothing algorithm. Currently defaults to 'lowess' for smoothing and 'strucchange' for breakpoint identification. The package is useful in areas such as trend analysis, time series decomposition, breakpoint identification and anomaly detection.


StructuralDecompose

CRAN status

Please note that the package is currently submitted to CRAN. CRAN submissions take a long time. Please use the github download to access the code. Note: This website is under construction, please use the current version of R and Python here. The documentation will be updated in the coming days

StructuralDecompose is an algorithm suited to the decomposition of a time series into it's component terms of trend, seasonality and residuals. It is well suited to decompose a series in the presence of significant level shifts.

The algorithm outputs the decomposed trend, seasonality, residuals as well as anomalies detected.

Installation

You can install the development version of StructuralDecompose like so:

package(StructuralDecompose)
install_github("StructuralDecompose/StructuralDecompose")

Example

An example code:

Note that we can specify the break algorithm and the smoothing algorithm as well. If the setting is set to 'auto', it will optimize which algorithm to use.

It is best to keep the default algorithms.

library(StructuralDecompose)

StructuralDecompose <- function(Data, frequency = 12, break_algorithm = 'strucchange', smoothening_algorithm = 'lowess', break_level = 0.05, median_level = 0.5, mean_level = 0.5, level_length = 0.5, conf_level = 0.5)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("StructuralDecompose")

0.1.1 by Allen Sunny, 4 years ago


https://allen-1242.github.io/StructuralDecompose/


Browse source code at https://github.com/cran/StructuralDecompose


Authors: Allen Sunny [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports changepoint, segmented, strucchange

Suggests knitr, rmarkdown, testthat


See at CRAN