Skip to content

StructuredObservable protocol for generator-level functionals #35

@jc-macdonald

Description

@jc-macdonald

StructuredObservable protocol for generator-level functionals

Extend protocols.py with a StructuredObservable protocol that represents generator-level dynamical quantities (as defined in MFAI proposal), complementing the existing Observable protocol which handles data-level summaries.

Motivation

Current Observable protocol maps (prediction, observation) → score. StructuredObservable maps generator/model → dynamical quantity (spectral radius, bifurcation threshold, stability margin, etc.) without requiring observation data. This is the key object for observable-based model criticism and the lawful learning Ex3 pipeline.

Protocol

class StructuredObservable(Protocol):
    name: str
    def __call__(self, generator: Any) -> np.ndarray: ...
    def from_trajectory(self, trajectory: np.ndarray, grid: np.ndarray) -> np.ndarray: ...

Implementation

  • StructuredObservable protocol in protocols.py
  • Tier enum extension: add STRUCTURAL tier alongside existing tiers
  • ObservableBundle: collection of structured observables with joint evaluation
  • Example implementations: gradient norm, spectral gap, curvature (kappa), skewness (xi)
  • Integration with Study: structured observables as post-hoc diagnostics

Source code reference

  • Thoery_1_Code.ipynb: compute_observables_from_ode (9 structured observables: I, rho, Sigma, kappa, xi, etc.)
  • Chemostat_Simulator.ipynb: all functional observables (I, rho, Sigma, kappa, xi, Pf, pi, t_max, max_n)
  • MFAI.tex: Definition of structured observable as map from generator to Banach-valued quantity

Tests

  • Protocol compliance checks
  • Known-system validation: SIR → R0, epidemic peak timing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions