Learn R Programming

SSAforecast (version 0.1.1)

SSAdecomp: Singular Spectrum Analysis Decomposition For Time Series Data

Description

Singular Spectrum Analysis (SSA) is an innovative time series analysis technique based on multivariate statistical principles. It decomposes a time series into distinct additive components, including trends, periodic or quasi-periodic patterns, and residuals. The function provides tools for decomposition and reconstruction, and the returned object can be further printed or summarized. Optional verbose output is available to display correlation diagnostics during execution.

Usage

SSAdecomp(data, L = 12, corr_thr = 0.97, horizon = 12, verbose = FALSE)

Value

An object of class "SSAdecomp" containing:

trend_component

Reconstructed trend component of the time series.

recon_components

List of reconstructed seasonal and residual components from correlated groups.

corr_pairs

List of high correlation pairs with correlation values.

Arguments

data

Univariate time series data.

L

Integer, window length, multiple of periodicity of data series.

corr_thr

Numeric, threshold for correlation between the component pairs (default 0.97).

horizon

Integer, step ahead forecasting horizon.

verbose

Logical, if TRUE, prints messages with correlation diagnostics (default FALSE).

Details

SSA decomposes a time series into interpretable components such as trends, oscillations, and noise without strict distributional and structural assumptions (Golyandina and Zhigljavsky, 2013). It is widely used for trend identification, smoothing, seasonality extraction, and forecasting (Hassani et al., 2007).

The returned object is of class "SSAdecomp" and comes with a custom print method for user-friendly display.

Examples

Run this code
# Example using a sample time series
tsdata <- ts(rnorm(120), frequency = 12)
res <- SSAdecomp(data = tsdata, L = 12, corr_thr = 0.97, horizon = 12)

# Print summary
print(res)

# Show detailed correlation messages
res_verbose <- SSAdecomp(data = tsdata, L = 12, corr_thr = 0.97, horizon = 12, verbose = TRUE)

Run the code above in your browser using DataLab