NSSDNResult.spectral_state#

NSSDNResult.spectral_state(*, active_threshold=None)[source]#

The decomposition read as a time-local spectral measure.

Normalizes the contribution powers \(\tilde A_{t,k}^2\) into weights on the frequency axis and computes the centroid, dispersion, entropy, effective count, Wasserstein velocity and disentanglement score of the resulting measure at every row; see spectral_state for the definitions.

Parameters:

active_threshold (float | None) – Power-weight floor in \([0, 1]\) below which a component is inactive for the diagnostics; the package default (\(10^{-2}\)) when None.

Return type:

SpectralState

Returns:

A SpectralState with one row per path row.

Raises:

SpecificationError – If the threshold lies outside \([0, 1]\).

Example

>>> import numpy as np
>>> y = np.sin(0.2 * np.arange(120.0))
>>> res = NSSDN(y, k=2, state_dim=8, schedule=(Stage(1e-2, 20),), seed=0).fit()
>>> state = res.spectral_state()
>>> state.nobs, state.k, state.centroid.shape
(120, 2, (120,))