tensorflow / tensorflow/probability

`LinearGaussianStateSpaceModel` filtering initial state is incorrect

Open
#1,797 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

The initial state for filter step is wrong, and is p(x0), when it should be p(x1|x0), i.e. kalman transition should already be applied to the initial state. This line.

Since the filter step does update first and transition second, the prior input to update step is expecting input to be p(x_k | x_k-1). This is performed in linear_gaussian_update, and you can see that it takes the carry value, which would point to p(x0) initially.

Further: to see why, take a look at the sampling method. The initial state is p(x0) and the sampling performs a transition first before sampling the observables.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at line 985 of tensorflow_probability/python/distributions/linear_gaussian_ssm.py and inspect how the filter's initial carry reaches linear_gaussian_update at line 1690. Compare this with the initial-state handling at line 752 and the transition before observables at line 2006. Done means the filter applies the transition before its first update, matching the sampling order.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.