tensorflow / tensorflow/probability
`LinearGaussianStateSpaceModel` filtering initial state is incorrect
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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