mixle.ppl.statespace moduleΒΆ

Linear-Gaussian state-space models for mixle.ppl (Kalman filter + RTS smoother + EM).

A univariate latent state evolves as x_t = phi * x_{t-1} + w_t (w ~ N(0, q)) and is observed as y_t = x_t + v_t (v ~ N(0, r)). LocalLevel() fixes phi = 1 (a random walk + noise / trend smoother); AR1() estimates phi. Fitting is EM: the E-step is the Kalman/RTS smoother, the M-step updates phi, q, r.

class StateSpaceResult(phi, q, r, x0, P0, smoothed, smoothed_var, loglik)[source]

Bases: object

forecast(h)[source]

Point forecasts h steps ahead from the last smoothed state.

Parameters:

h (int)

summary()[source]
statespace_fit(rv, data, *, max_its=200, tol=1e-6, **_)[source]
Parameters:
  • rv (RandomVariable)

  • max_its (int)

  • tol (float)

Return type:

RandomVariable