Diagnostics
Filters, trackers, and samplers should expose diagnostics through explicit
return paths rather than printing or relying on private attributes. The module
pyrecest.diagnostics defines lightweight dataclasses for common diagnostic
families:
FilterDiagnosticsfor innovation, NIS, NEES, log likelihood, and covariance trace;ParticleDiagnosticsfor effective sample size, resampling decisions, and weight entropy;AssociationDiagnosticsfor cost matrices, gated measurements, assignments, births, and deaths.
A recommended pattern is:
state, diagnostics = filter.update(measurement, return_diagnostics=True)
APIs that do not yet support diagnostics should avoid ad-hoc return tuples and instead add a documented diagnostics object when the feature is introduced.