Skip to content

Obtain Kalman gains from parallel algorithm #10

Discussion options

You must be logged in to vote

So, the answer is: if there is a direct way I can't see it. The gain is a non-linear function of the innovation covariance, so it's not obvious from the current formulation.
On the other hand, you can relatively easily get them in parallel after the fact: once you have obtained the filtering mean and covariances, you can simply apply these steps in parallel to the filtered_covariances shifted by 1.

P = model.F @ P @ model.F.T + model.Q
S = model.H @ P @ model.H.T + model.R
K = jsc.linalg.solve(S, model.H @ P, assume_a='pos').T

I.e., if the function is get_K(P), you can do

Ps = jnp.insert(fPs[:-1], P0, 0, 0)
Ks = jax.vmap(get_K)(Ps)

and that should do the trick.

There may be a trick to do …

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dominikstrb
Comment options

You must be logged in to vote
1 reply
@AdrienCorenflos
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants