Type: | Package |
Title: | SSA Based Decomposition and Forecasting |
Version: | 0.1.1 |
Maintainer: | Rajeev Ranjan Kumar <rrk.uasd@gmail.com> |
Description: | Singular spectrum analysis (SSA) decomposes a time series into interpretable components like trends, oscillations, and noise without strict distributional and structural assumptions. For method details see Golyandina N, Zhigljavsky A (2013). <doi:10.1007/978-3-642-34913-3>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.3.2 |
Imports: | Rssa |
Depends: | R (≥ 3.6) |
NeedsCompilation: | no |
Packaged: | 2025-09-16 09:59:53 UTC; pc |
Author: | Prabhat Kumar [aut, ctb], Girish Kumar Jha [aut, ths, ctb], Rajeev Ranjan Kumar [aut, ctb, cre] |
Repository: | CRAN |
Date/Publication: | 2025-09-22 07:50:23 UTC |
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)
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 |
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.
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. |
Examples
# 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)
Singular Spectrum Analysis Based Time Series Forecasting Model
Description
One of the main advantages of SSA is that it can generate forecasts for either the individual components of a time series or the reconstructed series after it has been decomposed (Ghodsi et al., 2018). SSA-Linear Recurrent Formulae (SSA-LRF) model has been employed successfully in hydrological forecasting and other practical applications (Zhang et al., 2011).
Usage
SSAfcast(data, L=12, corr_thr=0.97,horizon=12)
Arguments
data |
Univariate time series data |
L |
Integer, window length, multiple of periodicity of data series |
corr_thr |
Correlation between the component pairs (0.97 default) |
horizon |
Step ahead forecasting |
Details
SSA decomposes a time series into interpretable components like trends, oscillations, and noise without strict distributional and structural assumptions (Golyandina and Zhigljavsky, 2013). SSA offers various applications, including trend identification, smoothing, seasonality extraction, and forecasting (Hassani et al., 2007). SSA Linear Recurrent Formulae model has been employed successfully in hydrological forecasting and other practical applications (Zhang et al., 2011). Finally, the prediction results of all the three components are aggregated to formulate an ensemble output for the input time series.
Value
Final_forecast |
Final forecasted value of the SSA based forecasting model. It is obtained by combining the forecasted value of all individual reconstruction series |
Data_test |
Test data of univariate time series |
RMSE_SSA |
Root Mean Square Error (RMSE) for SSA based forecasting model |
MAPE_SSA |
Mean Absolute Percentage Error (MAPE) for SSA based forecasting model |
MAE_SSA |
Mean Absolute Error (MAE) for SSA based forecasting model |
References
Hassani, H (2007). Singular Spectrum Analysis: Methodology and Comparison. Journal of Data Science, 5(2), 239-257.
Examples
set.seed(123)
ts_data <- rnorm(100)
result <- SSAfcast(ts_data, L = 12, corr_thr = 0.95, horizon = 10)
result
Time series data
Description
This investigation is done on the monthly wholesale price of the potato crop wholesale markets of Agra. The price series obtained from the Directorate of Marketing and Inspection (DMI), Ministry of Agriculture and Farmers Welfare, Government of India from January 2010 to March 2023. Total price series has 159 observations, which are split 147 data points into training and 12 points data into testing sets respectively.
Usage
data("tsdata")
Details
Total price series has 159 observations, which are split 147 data points into training and 12 points data into testing sets respectively.
Source
GOI
Examples
data(tsdata)