DimensionError#

exception ns_sdn.exceptions.DimensionError[source]#

Bases: NSSDNError, ValueError

An input has the wrong rank, length, or alignment.

The data are the right kind of thing in the wrong shape: a series with more than one column, fewer observations than the model needs, covariates or a time grid whose length differs from the series, or future covariates whose shape differs from what a forecast of that horizon requires. The fix is to reshape or realign the input; the message quotes both shapes.

Example

>>> import numpy as np
>>> from ns_sdn.spectral_decomposition import NSSDN
>>> NSSDN(np.arange(10.0), exog=np.ones((9, 2)))
Traceback (most recent call last):
    ...
ns_sdn.exceptions.DimensionError: exog has 9 rows but the series has 10.