SciML / DifferenceEquations.jl

Solving difference equations with DifferenceEquations.jl and the SciML ecosystem.
MIT License
32 stars 6 forks source link

Kalman priors #9

Closed cpfiffer closed 2 years ago

cpfiffer commented 2 years ago

Not sure if this is the best way to handle the mean/variance priors about u0 -- currently the KalmanFilter accepts subtypes of Distribution, but I think we should either consider a more robust way of getting mean/variance parameters out of u0. I might need to see a use-case that would break this though, since it seems capable of handling the bulk of DifferenceEquations use right now.

https://github.com/SciML/DifferenceEquations.jl/blob/7dcbb7a389211db2c8574d440a0c337cbcc4d819/src/kalman.jl#L16-L18

wupeifan commented 2 years ago

If you are going to apply the Kalman filter, then Normal distribution would be the only valid choice; in contrast, if in any case, we are going to approximate the posterior updates with this linear-quadratic form, it has to be extracting the mean and variance from a distribution. It's just when u0 is Normal this Bayesian updating process is exact.

... anyway, I personally am totally fine with this way of handling priors unless there's a better proposal.