SpectralState.to_dict#
- SpectralState.to_dict()[source]#
The scalar coordinates as aligned arrays of
nobsrows.The three velocities are padded with
nanin row 0 so every column hasnobsentries and row \(i\) of a velocity is the motion into row \(i\).n_activeis the number of active components per row as a float.- Return type:
- Returns:
Arrays keyed
centroid, dispersion, entropy, effective_count, participation_ratio, velocity, velocity_frequency, velocity_mass, n_active.
Example
>>> import numpy as np >>> from ns_sdn.spectral_decomposition import NSSDN, Stage >>> y = np.sin(0.3 * np.arange(160.0)) >>> res = NSSDN(y, k=2, state_dim=8, schedule=(Stage(1e-2, 20),), seed=0).fit() >>> out = res.spectral_state().to_dict() >>> len(out), "n_active" in out, bool(np.isnan(out["velocity"][0])) (9, True, True) >>> out["velocity"].shape, bool(out["n_active"].max() <= 2.0) ((160,), True)