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_windows non-overlapping segments (same segmentation and per-segment statistics as ramping_windows(): mean, variance, skewness, and lag-1 autocorrelation, forming a num_windows x 4 matrix), then applies Slow Feature Analysis (SFA) to find the linear combination of these four 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.

References

invariances.” Neural Computation 14(4), 715-770 (2002).

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 than ramping_windows()’ default of 10) because SFA needs enough windows to estimate the underlying 4x4 covariance matrices (of the statistics, and of their increments) reasonably reliably – at num_windows = 10 the 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 four SFA eigenvalues (spread of the slowness spectrum).

  • pc1VarFrac: the fraction of total variance (across the four 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.

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