Skip to content

sidLTVStateEst

Python equivalent: sid.ltv_state_est

Batch LTV state estimation (RTS smoother).

X_hat = sidLTVStateEst(Y, U, A, B, H)
X_hat = sidLTVStateEst(Y, U, A, B, H, 'R', R, 'Q', Q)

Estimates state trajectories for a discrete-time LTV system with partial observations by minimising:

J = sum_k ||y(k) - H x(k)||^2_{\(R^{-1}\)} + sum_k ||\(x(k+1)\) - A(k) x(k) - B(k) u(k)||^2_{\(Q^{-1}\)}

This is equivalent to a Rauch-Tung-Striebel (RTS) fixed-interval smoother. Solved via a block tridiagonal forward-backward pass in O(N n^3) per trajectory.

Inputs

Name Description
Y Output data, (N+1 x py), (N+1 x py x L), or cell array {L x 1}
where Y{l} is (N_l+1 x py). Cell arrays allow variable-length
trajectories.
U Input data, (N x q), (N x q x L), or cell array {L x 1}
where U{l} is (N_l x q). Must match Y format.
A Dynamics matrices, (n x n x N).
B Input matrices, (n x q x N).
H Observation matrix, (py x n).

Name-value options

Name Description
'R' Measurement noise covariance, (py x py) SPD. Default: eye(py).
'Q' Process noise covariance, (n x n) SPD. Default: eye(n).

Outputs

Name Description
X_hat Estimated states, (N+1 x n x L) or cell {L x 1} where
X_hat{l} is (N_l+1 x n). Cell output when Y is a cell.

Examples

% State estimation with known dynamics
X_hat = sidLTVStateEst(Y, U, A, B, H);
% With known measurement and process noise
X_hat = sidLTVStateEst(Y, U, A, B, H, 'R', R_meas, 'Q', Q_proc);

Algorithm

Block tridiagonal Gaussian elimination per docs/cosmic_output.md Appendix A. Per trajectory, builds n x n diagonal blocks S{k}, off-diagonal U{k} = -A(k)' \(Q^{-1}\), and RHS Theta{k}, then calls sidLTVblkTriSolve.

Specification

SPEC.md section 8.12 -- Output-COSMIC state step docs/cosmic_output.md -- Appendix A

See also

sidLTVblkTriSolve, sidLTVdiscIO, sidLTVdisc

Changelog

  • 2026-04-01: First version by Pedro Lourenço.