pyhctsa.operations.stationarity.slow_feature_analysis¶
-
pyhctsa.operations.stationarity.slow_feature_analysis(y, num_windows=
20)¶ Slow feature analysis of windowed statistics.
Splits the time series into
num_windowsnon-overlapping segments (same segmentation and per-segment statistics asramping_windows(): mean, variance, skewness, and lag-1 autocorrelation, plus lag-1 trev, a normalized third-order cross-moment measuring time-reversal asymmetry,mean(dz^3) / mean(dz^2)^(3/2)withdz = diff(window), forming anum_windowsx 5 matrix), then applies Slow Feature Analysis (SFA) to find the linear combination of these five statistics that varies as slowly as possible across the sequence of windows – i.e., minimizes the variance of its own increments, subject to unit variance. The lag-1 autocorrelation is symmetric under time reversal, so trev is included to let SFA pick up a slow drift in the irreversibility of the dynamics.This operation is a compact variant of feature-based SFA (f-SFA) [2]_, which applies SFA to sliding-window catch22/catch24 features; here five fixed window statistics are used, to give a single hctsa feature.
References
invariances.” Neural Computation 14(4), 715-770 (2002). .. [2] Owens, K.S., Tamaki, M. & Fulcher, B.D. “Parameter inference from a non-stationary unknown process using statistical feature-based slow feature analysis”, arXiv:2609.01651 (2026). The full feature-based method (f-SFA: sliding-window catch22/catch24 features + SFA) is implemented in the Python package fsfa: https://github.com/KieranOwens/fsfa
- Parameters:¶
- y : array-like¶
The input time series.
- num_windows : int, optional¶
The number of non-overlapping segments to divide the time series into. Non-overlapping segments are used for the same reason as
ramping_windows(): overlap would induce artificial serial correlation between adjacent window statistics, which would make the derivative-based slowness measure spuriously small regardless of any real slow structure in the data. 20 was chosen (rather thanramping_windows()’ default of 10) because SFA needs enough windows to estimate the underlying 5x5 covariance matrices (of the statistics, and of their increments) reasonably reliably – atnum_windows = 10the null-distribution spread of the slowness eigenvalues is considerably wider, making individual values a noisier signal. Default is 20.
- Returns:¶
eta1: the smallest (slowest) SFA eigenvalue.etaEnd: the largest (fastest/noisiest) SFA eigenvalue.etaStd: the standard deviation of all SFA eigenvalues (spread of the slowness spectrum).pc1VarFrac: the fraction of total variance (across the five statistics) explained by the leading PCA component.slowPCA1corr: the absolute correlation between the slowest SFA component’s scores and the leading PCA component’s scores – near 1 means the slow direction is simply the dominant (highest-variance) direction PCA would already find; near 0 means SFA has isolated a genuinely separate, low-variance slow mode.slowCorrMean,slowCorrVar,slowCorrSkew,slowCorrAC1,slowCorrTrev: the absolute correlation between each raw per-window statistic (mean, variance, skewness, AC1, trev, before whitening) and the slowest SFA component’s scores, indicating which statistic drives the slow mode (NaN for a constant statistic).
Returns NaN if the time series is too short for the requested number of windows, or if fewer than two directions survive the whitening threshold.
- Return type:¶
dict