Skip to content

Exceptions

Every exception raised by the package derives from PMMError.

PMMError

Bases: Exception

Base class for every domain-level error raised by pmmforecast.

ParamPMMError

Bases: PMMError, ValueError

The five-tuple (a, b, c, d, e) does not define a valid PMM.

Raised by :class:~pmmforecast.models.param_pmm.ParamPMM when:

  • b == ±1 (the recursion divides by 1 - b**2);
  • c == ±1 (would force alpha_3 = beta_3 = 0);
  • the covariance matrix Gamma is not positive-definite;
  • Q_1 is singular (A = Q_2 Q_1^{-1} ill-defined);
  • BBt is not positive-definite;
  • sqrtm(BBt) reports a residual error above EPS.

NumericError

Bases: PMMError, FloatingPointError

A NaN/Inf has been produced by a filter / predictor recursion.

Indicates that the model's A/BBt are too ill-conditioned for finite-precision propagation. The offending step's index is included in the message so the call site can decide whether to abort or retry with a smaller horizon.

ConvergenceError

Bases: PMMError, RuntimeError

A sanity check on convergence has failed.

Currently raised when the filtering MSE strictly increases past the warm-up region or exceeds the marginal variance 1.0 — both of which contradict the analytic results of the paper and indicate a numerical blow-up.

ConfigError

Bases: PMMError, ValueError

A TOML session config is malformed or fails validation.

Carries the offending section/key in the message so the user knows where to look in their session file.