_models#

ns_sdn.engine._internals._models = <module 'ns_sdn.engine._internals._models' from '/home/runner/work/ns-sdn/ns-sdn/src/ns_sdn/engine/_internals/_models.py'>[source]#

Protected base classes for model specifications.

_BaseModel owns endog validation and the abstract fit. _SpectralDecompositionModel is the family base: it validates every specification argument at construction, builds the network, runs the schedule, and packs the raw outputs into a _SpectralFit. The public NSSDN class adds nothing but fit, which assembles the public result from that record and the specification.

Both bases are generic in the result type R so that a subclass’s fit is typed with its own result, and both use __slots__ so a specification cannot grow attributes after validation.

Example

>>> import numpy as np
>>> from ns_sdn.spectral_decomposition import NSSDN
>>> model = NSSDN(np.arange(10.0), time=np.arange(10.0) * 2.0)
>>> isinstance(model, _SpectralDecompositionModel), isinstance(model, _BaseModel)
(True, True)
>>> model.nobs_total, model.exog_dim, model.positive_frequency
(10, 0, True)