archimedes.sysid.PEMObjectiveΒΆ

class archimedes.sysid.PEMObjective(predictor: KalmanFilterBase, data: Timeseries, P0: np.ndarray, x0: np.ndarray = None)ΒΆ

Prediction Error Minimization objective function for system identification.

Low-level interface for PEM optimization that provides both residual and cost function evaluations. This class encapsulates the Kalman filter forward pass and automatic differentiation for gradient computation.

This is typically used internally by pem(). For most applications, use the higher-level pem() function directly. This can be useful mainly for constructing custom optimization workflows.

Parameters:
  • predictor (KalmanFilterBase) – Kalman filter implementing the system model with step(t, x, y, P, args) method.

  • data (Timeseries) – Input-output data with ts, us, and ys arrays.

  • P0 (array_like) – Initial state covariance matrix of shape (nx, nx).

  • x0 (array_like, optional) – Initial state estimate of shape (nx,). If None, the optimization variables should include both initial state and parameters.

Notes

The objective implements the prediction error formulation:

J = (1/N) Ξ£[k=1 to N] e[k]α΅€ e[k]

where e[k] are the Kalman filter innovations (prediction errors).

See also

pem

High-level parameter estimation interface

__init__(predictor: KalmanFilterBase, data: Timeseries, P0: np.ndarray, x0: np.ndarray = None) NoneΒΆ

Methods

__init__(predictor, data, P0[, x0])

forward(x0, params)

Run Kalman filter forward pass and compute prediction errors.

replace(**updates)

Returns a new object replacing the specified fields with new values.

residuals(decision_variables)

Evaluate prediction error residuals for least-squares optimization.

Attributes

x0

predictor

data

P0