NonlinearSSM.particle_smoother#

NonlinearSSM.particle_smoother(y, *, n_particles=500, ess_threshold=0.5, seed=None)[source]#

Forward-filtering backward-smoothing (Doucet-Godsill-Andrieu).

A bootstrap forward pass stores every weighted cloud, and the backward recursion reweights each of them through the transition density N(f(x), Q). That density is why the method’s reach differs from the particle filter’s: a custom observation_loglik is fine (it only enters the forward weights), but a custom transition_sampler exposes draws without a density and is refused, as is a singular Q.

The costs are quadratic and stated rather than hidden: time is O(n_particles**2) per period and the forward clouds are held in full, so the default cloud is smaller than the filter’s – raise it only knowing both bills scale with its square and its size respectively.

Parameters:
  • y (ArrayLike) – Data, (n, p); numpy.nan rows are missing.

  • n_particles (int) – Cloud size, at least 2.

  • ess_threshold (float) – Forward-pass resampling trigger, as in the bootstrap filter.

  • seed (int | Generator | None) – Seed or generator.

Return type:

_ParticleSmootherResult

Returns:

The _ParticleSmootherResult.

Raises:
  • SpecificationError – If the model carries a transition sampler hook or the bookkeeping is malformed.

  • NumericalError – If Q is singular or the cloud degenerates.