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-levelpem()
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
, andys
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