Priors
Gaussian Markov process prior models.
ode_filters.priors.IWP
Bases: BasePrior
Integrated Wiener Process prior model.
ode_filters.priors.IWP.A(h: float) -> Array
Return the state transition matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
State transition matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.IWP.b(h: float) -> Array
Return the drift vector for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [(q+1)*d]). |
ode_filters.priors.IWP.Q(h: float) -> Array
Return the diffusion matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Diffusion matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.JointPrior
Bases: BasePrior
Joint prior combining independent state (x) and hidden/input (u) priors.
Creates a block-diagonal prior structure where state and hidden evolution are independent. The resulting matrices are block-diagonal with zeros in the off-diagonal blocks.
For joint state-parameter estimation, the hidden state u can represent unknown parameters that appear in the ODE but evolve according to their own prior (e.g., IWP or Matern).
Projection matrices
E0: Extracts [x, u] - zeroth derivatives of both (shape [d_x + d_u, D]) E0_x: Extracts x only - zeroth derivative of state (shape [d_x, D]) E0_hidden: Extracts u only - zeroth derivative of hidden (shape [d_u, D]) E1: Extracts dx/dt - first derivative of state x (shape [d_x, D]) E2: Extracts d^2x/dt^2 - second derivative of x (shape [d_x, D]), if q >= 2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prior_x
|
BasePrior
|
BasePrior instance for state evolution. |
required |
prior_u
|
BasePrior
|
BasePrior instance for hidden/input evolution. |
required |
ode_filters.priors.JointPrior.E0_x: Array
property
State extraction matrix for x only (shape [d_x, D]).
Use this as E0 in the measurement model when you have hidden states.
ode_filters.priors.JointPrior.E0_hidden: Array
property
Hidden state extraction matrix for u only (shape [d_u, D]).
Use this as E0_hidden in the measurement model.
ode_filters.priors.JointPrior.E0_state: Array
property
State-only value projection (Bosch et al. 2022 sec. 3).
ode_filters.priors.JointPrior.xi_state: Array
property
State-prior component-correlation matrix (shape [d_x, d_x]).
Diagonal-mode calibration only requires the state block to be per-component diagonal; the hidden block's xi can be arbitrary.
ode_filters.priors.JointPrior.A(h: float) -> Array
Return the block-diagonal state transition matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal transition matrix with state and input blocks. |
ode_filters.priors.JointPrior.b(h: float) -> Array
Return the concatenated drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Drift vector concatenating state and input drifts. |
ode_filters.priors.JointPrior.Q(h: float) -> Array
Return the block-diagonal diffusion matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal diffusion matrix with state and input blocks. |
ode_filters.priors.JointPrior.apply_state_sigma_sqr(Q_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of Q_sqr by sqrt(sigma_sqr).
Accepts a scalar (uniform state-block scaling) or a length-d_x
vector (per-component state-block scaling used by
calibration="diagonal"). In both cases the input block is
untouched. Q is block-diagonal, so its upper-triangular sqrt is
also block-diagonal: column-scaling the state block of the sqrt by
sqrt(sigma_sqr_tiled) yields blkdiag(diag(sigma) Q_x diag(sigma),
Q_u) (where diag(sigma) collapses to a scalar in the scalar
case).
ode_filters.priors.JointPrior.apply_state_sigma_to_cov_sqr(P_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of a full-state covariance sqrt.
P = P_sqr.T @ P_sqr. Multiplying columns [:, :D_x] of the
upper-triangular sqrt by sqrt(sigma_sqr) scales rows and
columns :D_x of P by sigma_sqr and leaves the input
block alone.
ode_filters.priors.MaternPrior
Bases: BasePrior
Matern Gaussian process prior model using block matrix exponential.
ode_filters.priors.MaternPrior.__init__(q: int, d: int, length_scale: float, Xi: ArrayLike | None = None)
Initialize the Matern prior.
This creates a Matern process prior for a d-dimensional process where each dimension is modeled independently by a q+1 times integrated Matern process of the same length scale with possibly different output scale (Xi).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
int
|
Smoothness order. |
required |
d
|
int
|
State dimension. |
required |
length_scale
|
float
|
Length scale of the process. |
required |
Xi
|
ArrayLike | None
|
Optional scaling matrix (shape [d, d]). |
None
|
ode_filters.priors.MaternPrior.A_and_Q(h: float) -> tuple[Array, Array]
Compute both A(h) and Q(h) efficiently in a single expm call. This is sometimes called matrix fraction decomposition (MFD)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Tuple of (A_h, Q_h) where: |
Array
|
|
tuple[Array, Array]
|
|
ode_filters.priors.MaternPrior.A(h: float) -> Array
Return the state transition matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
State transition matrix (shape [n, n]). |
ode_filters.priors.MaternPrior.b(h: float) -> Array
Return the drift vector for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [n]). |
ode_filters.priors.MaternPrior.Q(h: float) -> Array
Return the diffusion matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Diffusion matrix (shape [n, n]). |
ode_filters.priors.PrecondIWP
Bases: BasePrior
Preconditioned Integrated Wiener Process prior.
Uses a preconditioning transformation T(h) to make matrices stepsize-independent. The transformation matrices A() and Q() are constant (independent of h), while the stepsize dependence is absorbed into T(h).
ode_filters.priors.PrecondIWP.A(h: float | None = None) -> Array
Return the constant preconditioning transition matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Constant transition matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.PrecondIWP.b(h: float | None = None) -> Array
Return the zero drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [(q+1)*d]). |
ode_filters.priors.PrecondIWP.Q(h: float | None = None) -> Array
Return the constant preconditioning diffusion matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Constant diffusion matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.PrecondIWP.T(h: float) -> Array
Return the stepsize-dependent preconditioning transformation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioning transformation matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.PrecondJointPrior
Joint prior for preconditioned priors combining state (x) and hidden (u).
This is the preconditioned version of JointPrior, designed specifically for PrecondIWP priors. The matrices A(), b(), Q() are constant (stepsize-independent), with the stepsize dependence absorbed into T(h).
Note: Mixing preconditioned and non-preconditioned priors is not supported and would lead to inconsistent filter behavior.
Projection matrices
E0: Extracts [x, u] - zeroth derivatives of both (shape [d_x + d_u, D]) E0_x: Extracts x only - zeroth derivative of state (shape [d_x, D]) E0_hidden: Extracts u only - zeroth derivative of hidden (shape [d_u, D]) E1: Extracts dx/dt - first derivative of state x (shape [d_x, D]) E2: Extracts d^2x/dt^2 - second derivative of x (shape [d_x, D]), if q >= 2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prior_x
|
PrecondIWP | PrecondMaternPrior
|
PrecondIWP instance for state evolution. |
required |
prior_u
|
PrecondIWP | PrecondMaternPrior
|
PrecondIWP instance for hidden/input evolution. |
required |
Example
prior_x = PrecondIWP(q=2, d=2) prior_u = PrecondIWP(q=1, d=1) joint = PrecondJointPrior(prior_x, prior_u) A = joint.A() # Constant transition matrix T_h = joint.T(0.1) # Stepsize-dependent transformation
ode_filters.priors.PrecondJointPrior.E0: Array
property
Combined state extraction matrix (shape [d_x + d_u, D]).
ode_filters.priors.PrecondJointPrior.E0_x: Array
property
State extraction matrix for x only (shape [d_x, D]).
Use this as E0 in the measurement model when you have hidden states.
ode_filters.priors.PrecondJointPrior.E0_hidden: Array
property
Hidden state extraction matrix for u only (shape [d_u, D]).
Use this as E0_hidden in the measurement model.
ode_filters.priors.PrecondJointPrior.E1: Array
property
First derivative extraction matrix for x (shape [d_x, D]).
ode_filters.priors.PrecondJointPrior.E2: Array | None
property
Second derivative extraction matrix for x (shape [d_x, D]), or None.
ode_filters.priors.PrecondJointPrior.E0_state: Array
property
State-only value projection (Bosch et al. 2022 sec. 3).
ode_filters.priors.PrecondJointPrior.xi_state: Array
property
State-prior component-correlation matrix (shape [d_x, d_x]).
ode_filters.priors.PrecondJointPrior.A(h: float | None = None) -> Array
Return the block-diagonal transition matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (passed through to sub-priors). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal transition matrix with state and hidden blocks. |
ode_filters.priors.PrecondJointPrior.b(h: float | None = None) -> Array
Return the zero drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (passed through to sub-priors). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [D_x + D_u]). |
ode_filters.priors.PrecondJointPrior.Q(h: float | None = None) -> Array
Return the block-diagonal diffusion matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (passed through to sub-priors). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal diffusion matrix with state and hidden blocks. |
ode_filters.priors.PrecondJointPrior.T(h: float) -> Array
Return the stepsize-dependent block-diagonal transformation matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal preconditioning transformation matrix. |
ode_filters.priors.PrecondJointPrior.apply_state_sigma_sqr(Q_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of Q_sqr by sqrt(sigma_sqr).
Accepts a scalar or a length-d_x vector. See
:meth:JointPrior.apply_state_sigma_sqr for the rationale.
ode_filters.priors.PrecondJointPrior.apply_state_sigma_to_cov_sqr(P_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of a full-state covariance sqrt.
See :meth:JointPrior.apply_state_sigma_to_cov_sqr for the rationale.
ode_filters.priors.PrecondMaternPrior
Bases: BasePrior
Preconditioned Matern Gaussian process prior model.
Uses the same diagonal preconditioner D(h) as PrecondIWP, but the preconditioned transition A_bar(h) and diffusion Q_bar(h) are stepsize-dependent (they converge to the IWP constants as h -> 0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
int
|
Smoothness order (nu = q + 1/2). |
required |
d
|
int
|
State dimension. |
required |
length_scale
|
float
|
Length scale of the Matern process. |
required |
Xi
|
ArrayLike | None
|
Optional scaling matrix (shape [d, d]). |
None
|
ode_filters.priors.PrecondMaternPrior.A(h: float) -> Array
Return the preconditioned transition matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioned transition matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.PrecondMaternPrior.Q(h: float) -> Array
Return the preconditioned diffusion matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioned diffusion matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.PrecondMaternPrior.b(h: float | None = None) -> Array
Return the zero drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [(q+1)*d]). |
ode_filters.priors.PrecondMaternPrior.T(h: float) -> Array
Return the stepsize-dependent preconditioning transformation.
Uses the same preconditioner as PrecondIWP.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioning transformation matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.taylor_mode_initialization(vf: VectorField, inits: ArrayLike | tuple[ArrayLike, ...], q: int, t0: float = 0.0, order: int = 1) -> tuple[Array, Array]
Return flattened Taylor-mode coefficients produced via JAX Jet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vf
|
VectorField
|
Vector field whose Taylor coefficients are required. For order=1: vf(x, , t) -> dx/dt For order=2: vf(x, dx, , t) -> d²x/dt² |
required |
inits
|
ArrayLike | tuple[ArrayLike, ...]
|
Initial value(s) around which the expansion takes place. For order=1: x0 (initial state) For order=2: (x0, dx0) tuple of initial state and velocity |
required |
q
|
int
|
Number of higher-order coefficients to compute. |
required |
t0
|
float
|
Initial time for Taylor expansion (default 0.0). |
0.0
|
order
|
int
|
ODE order (1 or 2, default 1). |
1
|
Returns:
| Type | Description |
|---|---|
Array
|
Tuple of (coefficients, covariance) where: |
Array
|
|
tuple[Array, Array]
|
|
ode_filters.priors.gmp_priors
ode_filters.priors.gmp_priors.BasePrior
Bases: ABC
ode_filters.priors.gmp_priors.BasePrior.E0: Array
property
State extraction matrix (shape [d, (q+1)*d]).
ode_filters.priors.gmp_priors.BasePrior.E1: Array
property
First derivative extraction matrix (shape [d, (q+1)*d]).
ode_filters.priors.gmp_priors.BasePrior.E2: Array | None
property
Second derivative extraction matrix (shape [d, (q+1)*d]), or None if q < 2.
ode_filters.priors.gmp_priors.BasePrior.E0_state: Array
property
State-only value projection used by the step-size error norm.
Bosch, Tronarp, Hennig (2022) sec. 3 recommends that the local
error vector have the dimension of the ODE solution. For non-joint
priors the state is everything, so E0_state == E0. Joint priors
override to return the state-only extractor.
ode_filters.priors.gmp_priors.BasePrior.xi_state: Array
property
State-block component-correlation matrix Xi (shape [d, d]).
For non-joint priors this is just self.xi. Joint priors override
to return the state-prior's Xi — diagonal-mode calibration only
needs the state block to be (per-component) diagonal; the input
block can have arbitrary structure.
ode_filters.priors.gmp_priors.BasePrior.apply_state_sigma_sqr(Q_sqr: Array, sigma_sqr: ArrayLike) -> Array
Apply diffusion sigma_sqr to the state block of Q_sqr.
Accepts a scalar (uniform scaling) or a length-d vector
(per-component scaling, used by calibration="diagonal"). The
vector path scales each component's columns by sqrt(sigma_sqr[i])
across all q + 1 derivative orders.
For non-joint priors the whole Q is the state block, so the
scalar path is sqrt(sigma_sqr) * Q_sqr. Joint priors override to
leave the input block untouched (Schmidt et al. 2021 convention).
ode_filters.priors.gmp_priors.BasePrior.apply_state_sigma_to_cov_sqr(P_sqr: Array, sigma_sqr: ArrayLike) -> Array
Apply sigma_sqr to the state block of a full-state covariance sqrt.
Used by cumulative-mode post-multiplication of carried covariances. Default scales everything; joint priors override.
ode_filters.priors.gmp_priors.IWP
Bases: BasePrior
Integrated Wiener Process prior model.
ode_filters.priors.gmp_priors.IWP.A(h: float) -> Array
Return the state transition matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
State transition matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.IWP.b(h: float) -> Array
Return the drift vector for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [(q+1)*d]). |
ode_filters.priors.gmp_priors.IWP.Q(h: float) -> Array
Return the diffusion matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Diffusion matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.PrecondIWP
Bases: BasePrior
Preconditioned Integrated Wiener Process prior.
Uses a preconditioning transformation T(h) to make matrices stepsize-independent. The transformation matrices A() and Q() are constant (independent of h), while the stepsize dependence is absorbed into T(h).
ode_filters.priors.gmp_priors.PrecondIWP.A(h: float | None = None) -> Array
Return the constant preconditioning transition matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Constant transition matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.PrecondIWP.b(h: float | None = None) -> Array
Return the zero drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [(q+1)*d]). |
ode_filters.priors.gmp_priors.PrecondIWP.Q(h: float | None = None) -> Array
Return the constant preconditioning diffusion matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Constant diffusion matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.PrecondIWP.T(h: float) -> Array
Return the stepsize-dependent preconditioning transformation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioning transformation matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.MaternPrior
Bases: BasePrior
Matern Gaussian process prior model using block matrix exponential.
ode_filters.priors.gmp_priors.MaternPrior.__init__(q: int, d: int, length_scale: float, Xi: ArrayLike | None = None)
Initialize the Matern prior.
This creates a Matern process prior for a d-dimensional process where each dimension is modeled independently by a q+1 times integrated Matern process of the same length scale with possibly different output scale (Xi).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
int
|
Smoothness order. |
required |
d
|
int
|
State dimension. |
required |
length_scale
|
float
|
Length scale of the process. |
required |
Xi
|
ArrayLike | None
|
Optional scaling matrix (shape [d, d]). |
None
|
ode_filters.priors.gmp_priors.MaternPrior.A_and_Q(h: float) -> tuple[Array, Array]
Compute both A(h) and Q(h) efficiently in a single expm call. This is sometimes called matrix fraction decomposition (MFD)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Tuple of (A_h, Q_h) where: |
Array
|
|
tuple[Array, Array]
|
|
ode_filters.priors.gmp_priors.MaternPrior.A(h: float) -> Array
Return the state transition matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
State transition matrix (shape [n, n]). |
ode_filters.priors.gmp_priors.MaternPrior.b(h: float) -> Array
Return the drift vector for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [n]). |
ode_filters.priors.gmp_priors.MaternPrior.Q(h: float) -> Array
Return the diffusion matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Diffusion matrix (shape [n, n]). |
ode_filters.priors.gmp_priors.PrecondMaternPrior
Bases: BasePrior
Preconditioned Matern Gaussian process prior model.
Uses the same diagonal preconditioner D(h) as PrecondIWP, but the preconditioned transition A_bar(h) and diffusion Q_bar(h) are stepsize-dependent (they converge to the IWP constants as h -> 0).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
q
|
int
|
Smoothness order (nu = q + 1/2). |
required |
d
|
int
|
State dimension. |
required |
length_scale
|
float
|
Length scale of the Matern process. |
required |
Xi
|
ArrayLike | None
|
Optional scaling matrix (shape [d, d]). |
None
|
ode_filters.priors.gmp_priors.PrecondMaternPrior.A(h: float) -> Array
Return the preconditioned transition matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioned transition matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.PrecondMaternPrior.Q(h: float) -> Array
Return the preconditioned diffusion matrix for step size h.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioned diffusion matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.PrecondMaternPrior.b(h: float | None = None) -> Array
Return the zero drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (unused, accepted for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [(q+1)*d]). |
ode_filters.priors.gmp_priors.PrecondMaternPrior.T(h: float) -> Array
Return the stepsize-dependent preconditioning transformation.
Uses the same preconditioner as PrecondIWP.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Preconditioning transformation matrix (shape [(q+1)d, (q+1)d]). |
ode_filters.priors.gmp_priors.JointPrior
Bases: BasePrior
Joint prior combining independent state (x) and hidden/input (u) priors.
Creates a block-diagonal prior structure where state and hidden evolution are independent. The resulting matrices are block-diagonal with zeros in the off-diagonal blocks.
For joint state-parameter estimation, the hidden state u can represent unknown parameters that appear in the ODE but evolve according to their own prior (e.g., IWP or Matern).
Projection matrices
E0: Extracts [x, u] - zeroth derivatives of both (shape [d_x + d_u, D]) E0_x: Extracts x only - zeroth derivative of state (shape [d_x, D]) E0_hidden: Extracts u only - zeroth derivative of hidden (shape [d_u, D]) E1: Extracts dx/dt - first derivative of state x (shape [d_x, D]) E2: Extracts d^2x/dt^2 - second derivative of x (shape [d_x, D]), if q >= 2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prior_x
|
BasePrior
|
BasePrior instance for state evolution. |
required |
prior_u
|
BasePrior
|
BasePrior instance for hidden/input evolution. |
required |
ode_filters.priors.gmp_priors.JointPrior.E0_x: Array
property
State extraction matrix for x only (shape [d_x, D]).
Use this as E0 in the measurement model when you have hidden states.
ode_filters.priors.gmp_priors.JointPrior.E0_hidden: Array
property
Hidden state extraction matrix for u only (shape [d_u, D]).
Use this as E0_hidden in the measurement model.
ode_filters.priors.gmp_priors.JointPrior.E0_state: Array
property
State-only value projection (Bosch et al. 2022 sec. 3).
ode_filters.priors.gmp_priors.JointPrior.xi_state: Array
property
State-prior component-correlation matrix (shape [d_x, d_x]).
Diagonal-mode calibration only requires the state block to be per-component diagonal; the hidden block's xi can be arbitrary.
ode_filters.priors.gmp_priors.JointPrior.A(h: float) -> Array
Return the block-diagonal state transition matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal transition matrix with state and input blocks. |
ode_filters.priors.gmp_priors.JointPrior.b(h: float) -> Array
Return the concatenated drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Drift vector concatenating state and input drifts. |
ode_filters.priors.gmp_priors.JointPrior.Q(h: float) -> Array
Return the block-diagonal diffusion matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal diffusion matrix with state and input blocks. |
ode_filters.priors.gmp_priors.JointPrior.apply_state_sigma_sqr(Q_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of Q_sqr by sqrt(sigma_sqr).
Accepts a scalar (uniform state-block scaling) or a length-d_x
vector (per-component state-block scaling used by
calibration="diagonal"). In both cases the input block is
untouched. Q is block-diagonal, so its upper-triangular sqrt is
also block-diagonal: column-scaling the state block of the sqrt by
sqrt(sigma_sqr_tiled) yields blkdiag(diag(sigma) Q_x diag(sigma),
Q_u) (where diag(sigma) collapses to a scalar in the scalar
case).
ode_filters.priors.gmp_priors.JointPrior.apply_state_sigma_to_cov_sqr(P_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of a full-state covariance sqrt.
P = P_sqr.T @ P_sqr. Multiplying columns [:, :D_x] of the
upper-triangular sqrt by sqrt(sigma_sqr) scales rows and
columns :D_x of P by sigma_sqr and leaves the input
block alone.
ode_filters.priors.gmp_priors.PrecondJointPrior
Joint prior for preconditioned priors combining state (x) and hidden (u).
This is the preconditioned version of JointPrior, designed specifically for PrecondIWP priors. The matrices A(), b(), Q() are constant (stepsize-independent), with the stepsize dependence absorbed into T(h).
Note: Mixing preconditioned and non-preconditioned priors is not supported and would lead to inconsistent filter behavior.
Projection matrices
E0: Extracts [x, u] - zeroth derivatives of both (shape [d_x + d_u, D]) E0_x: Extracts x only - zeroth derivative of state (shape [d_x, D]) E0_hidden: Extracts u only - zeroth derivative of hidden (shape [d_u, D]) E1: Extracts dx/dt - first derivative of state x (shape [d_x, D]) E2: Extracts d^2x/dt^2 - second derivative of x (shape [d_x, D]), if q >= 2
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prior_x
|
PrecondIWP | PrecondMaternPrior
|
PrecondIWP instance for state evolution. |
required |
prior_u
|
PrecondIWP | PrecondMaternPrior
|
PrecondIWP instance for hidden/input evolution. |
required |
Example
prior_x = PrecondIWP(q=2, d=2) prior_u = PrecondIWP(q=1, d=1) joint = PrecondJointPrior(prior_x, prior_u) A = joint.A() # Constant transition matrix T_h = joint.T(0.1) # Stepsize-dependent transformation
ode_filters.priors.gmp_priors.PrecondJointPrior.E0: Array
property
Combined state extraction matrix (shape [d_x + d_u, D]).
ode_filters.priors.gmp_priors.PrecondJointPrior.E0_x: Array
property
State extraction matrix for x only (shape [d_x, D]).
Use this as E0 in the measurement model when you have hidden states.
ode_filters.priors.gmp_priors.PrecondJointPrior.E0_hidden: Array
property
Hidden state extraction matrix for u only (shape [d_u, D]).
Use this as E0_hidden in the measurement model.
ode_filters.priors.gmp_priors.PrecondJointPrior.E1: Array
property
First derivative extraction matrix for x (shape [d_x, D]).
ode_filters.priors.gmp_priors.PrecondJointPrior.E2: Array | None
property
Second derivative extraction matrix for x (shape [d_x, D]), or None.
ode_filters.priors.gmp_priors.PrecondJointPrior.E0_state: Array
property
State-only value projection (Bosch et al. 2022 sec. 3).
ode_filters.priors.gmp_priors.PrecondJointPrior.xi_state: Array
property
State-prior component-correlation matrix (shape [d_x, d_x]).
ode_filters.priors.gmp_priors.PrecondJointPrior.A(h: float | None = None) -> Array
Return the block-diagonal transition matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (passed through to sub-priors). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal transition matrix with state and hidden blocks. |
ode_filters.priors.gmp_priors.PrecondJointPrior.b(h: float | None = None) -> Array
Return the zero drift vector.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (passed through to sub-priors). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Zero drift vector (shape [D_x + D_u]). |
ode_filters.priors.gmp_priors.PrecondJointPrior.Q(h: float | None = None) -> Array
Return the block-diagonal diffusion matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float | None
|
Step size (passed through to sub-priors). |
None
|
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal diffusion matrix with state and hidden blocks. |
ode_filters.priors.gmp_priors.PrecondJointPrior.T(h: float) -> Array
Return the stepsize-dependent block-diagonal transformation matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
h
|
float
|
Step size. |
required |
Returns:
| Type | Description |
|---|---|
Array
|
Block-diagonal preconditioning transformation matrix. |
ode_filters.priors.gmp_priors.PrecondJointPrior.apply_state_sigma_sqr(Q_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of Q_sqr by sqrt(sigma_sqr).
Accepts a scalar or a length-d_x vector. See
:meth:JointPrior.apply_state_sigma_sqr for the rationale.
ode_filters.priors.gmp_priors.PrecondJointPrior.apply_state_sigma_to_cov_sqr(P_sqr: Array, sigma_sqr: ArrayLike) -> Array
Scale only the state block of a full-state covariance sqrt.
See :meth:JointPrior.apply_state_sigma_to_cov_sqr for the rationale.
ode_filters.priors.gmp_priors.taylor_mode_initialization(vf: VectorField, inits: ArrayLike | tuple[ArrayLike, ...], q: int, t0: float = 0.0, order: int = 1) -> tuple[Array, Array]
Return flattened Taylor-mode coefficients produced via JAX Jet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vf
|
VectorField
|
Vector field whose Taylor coefficients are required. For order=1: vf(x, , t) -> dx/dt For order=2: vf(x, dx, , t) -> d²x/dt² |
required |
inits
|
ArrayLike | tuple[ArrayLike, ...]
|
Initial value(s) around which the expansion takes place. For order=1: x0 (initial state) For order=2: (x0, dx0) tuple of initial state and velocity |
required |
q
|
int
|
Number of higher-order coefficients to compute. |
required |
t0
|
float
|
Initial time for Taylor expansion (default 0.0). |
0.0
|
order
|
int
|
ODE order (1 or 2, default 1). |
1
|
Returns:
| Type | Description |
|---|---|
Array
|
Tuple of (coefficients, covariance) where: |
Array
|
|
tuple[Array, Array]
|
|