pysdkit.ssa#

Created on 2025/02/06 10:35:36 @author: Whenxuan Wang @email: wwhenxuan@gmail.com

pysdkit._ssa.ssa

Created on 2025/02/06 18:26:39 @author: Whenxuan Wang @email: wwhenxuan@gmail.com

ssa.ssa#

Created on 2025/02/06 18:26:39 @author: Whenxuan Wang @email: wwhenxuan@gmail.com

class pysdkit._ssa.ssa.SSA(K: int = 3, mode='covar', lags: int | None = None, averaging: bool | None = True, extra_size: bool | None = False)[source]#

Bases: object

Singular Spectral Analysis (SSA) algorithm

Zhigljavsky, Anatoly Alexandrovich. “Singular spectrum analysis for time series: Introduction to this special issue.” Statistics and its Interface 3.3 (2010): 255-258.

MATLAB code: https://www.mathworks.com/matlabcentral/fileexchange/58967-singular-spectrum-analysis-beginners-guide

following steps of an SSA analysis: - creation of the trajectory matrix - calculation of the covariance matrix - eigendecomposition of the covariance matrix - resulting eigenvalues, eigenvectors - calculation of the principal components - reconstruction of the time series.

__call__(signal: ndarray) ndarray[source]#

allow instances to be called like functions

__init__(K: int = 3, mode='covar', lags: int | None = None, averaging: bool | None = True, extra_size: bool | None = False) None[source]#

Estimation the signal components based on the Singular Spectral Analysis (SSA) algorithm

Parameters:
  • K – order of the model (number of valuable components, size of signal subspace)

  • mode – the mode of lags matrix (i.e. trajectory (or caterpillar) matrix or its analouge), mode = {traj, full, covar, toeplitz, hankel}

  • lags – number of lags in correlation function (x.shape[0]//2 by default)

  • averaging – if True, then mean of each diagonal will be taken for diagonal averaging instead of just summarizing (True, by default)

  • extra_size – if True, than near doubled size of output will be returned

__module__ = 'pysdkit._ssa.ssa'#
__str__() str[source]#

Get the full name and abbreviation of the algorithm

__weakref__#

list of weak references to the object (if defined)

fit_transform(signal: ndarray) ndarray[source]#

Execute the Singular Spectral Analysis (SSA) algorithm to perform signal decomposition

Parameters:

signal – input signal of 1D ndarray

Returns:

the decomposed results of IMFs