Kalman Filters as discrete DBN #1451
Replies: 1 comment
-
I am not very familiar with the details of Kalman filter but I tried to read up a bit on it. It does seem to me that it should be possible to implement it in pgmpy.
Since the state transitions work as a Markov Chain, I think you can compute the transition matrix from the CPDs. We use a similar function for doing Gibbs sampling: https://github.com/pgmpy/pgmpy/blob/dev/pgmpy/sampling/Sampling.py#L377.
I think this should be equivalent to providing virtual evidence during inference. We do have an option for this for normal Bayesian Network inference (virtual_evidence): https://github.com/pgmpy/pgmpy/blob/dev/pgmpy/inference/ExactInference.py#L226. We will have to probably do something similar for the case of Dynamic Bayesian Network inference as well. Implementing this should be quite simple as it just requires some network modification during inference: https://link.springer.com/chapter/10.1007/978-3-642-31718-7_5 |
Beta Was this translation helpful? Give feedback.
-
Imagine I have a classical Kalman Filter, with prediciton and update.
The question is: can I use
pgmpy.models.DynamicBayesianNetwork
using discrete CDP to perform Kalman Filter?I can understand the I can use a
TabularCPD
to represent the transition through time (I call heretransition_matrix
) and the initial state of x using a probability mass function (hereinitial_cpd
). Lets say I can compute it easily through Monte Carlo Simulation (MCS
).So, the code would be more or less like this:
Now, the problem how I model the update step with the observation
z
. Does it would be a Tabular CDP dependent onx
?If yes,
something
would be 100x100 matrix.For the filtering task, I would multiply the updated result by the observation PMF and normalize it:
Why I am interested in that? Because I want do this inference task with any distribution and any function.
I am wondering if I can use
pgmpy
to model this problem: https://doi.org/10.1061/(ASCE)EM.1943-7889.0000024The initial state is a discretized exponential distribution, the function is a fracture mechanics equation (non-linear), and the observation is a discretized normal distribution.
So, there are two things I don't see how to do with
pgmpy
:transition_matrix
from a functionf
;z
withR
uncertainty.Am I missing something? If not, I would be interesting implement it in
pgmpy
?Beta Was this translation helpful? Give feedback.
All reactions