Skip to content

Develop Kalman filter on top of SimpleArray #601

@yungyuc

Description

@yungyuc

Create an initial implementation of the Kalman filter based on Choleskey decomposition.

Quick notes on the alogrithm for Kalman filter:

  • Predict

    $$x_{t|t-1} = F_t x_{t-1|t-1} + B_t u_t,$$
    $$P_{t|t-1} = F_t P_{t-1|t-1} F_t^\top + Q_t.$$

  • Innovation

    $$y_t = z_t - H_t x_{t|t-1},$$
    $$S_t = H_t P_{t|t-1} H_t^\top + R_t.$$

  • Gain (via solve)

    $$K_t = P_{t|t-1} H_t^\top S_t^{-1}.$$

  • Update

    $$x_{t|t} = x_{t|t-1} + K_t y_t,$$
    $$P_{t|t} = (I-K_t H_t) P_{t|t-1} (I-K_t H_t)^\top + K_t R_t K_t^\top.$$

To make the calculation precisely, the calculation of gain should be transformed like:

$$ S_t,K_t^\top ;=; \big(P_{t\mid t-1},H_t^\top\big)^\top. $$

Then we would solve the formula with Cholesky decomposition (LLT):

$$ K_t = \text{solve-with-LLT}\bigl(S_t,; (P_{t\mid t-1} H_t^\top)^\top\bigr)^\top. $$

The issue is created based on the comment: #588 (comment)

Sub-issues

Metadata

Metadata

Assignees

Labels

arrayMulti-dimensional array implementation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions