NSSDNResult.components#

property NSSDNResult.components: NDArray[float64][source]#

(r, k) the contribution of each component to the emission.

\[c_{t,k} = w_k\, g_{t,k}\, A_{t,k}\, \sin\!\bigl(\theta_{t,k} + \phi_{t,k}\bigr),\]

so that \(\hat y_t = B_t + \sum_k c_{t,k}\): summing over \(k\) and adding trend recovers emission to floating point precision.

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()
>>> rebuilt = res.trend + res.components.sum(axis=1)
>>> bool(np.allclose(rebuilt, res.emission, atol=1e-5))
True