ReactiveBayes / RxInfer.jl

Julia package for automated Bayesian inference on a factor graph with reactive message passing
MIT License
265 stars 23 forks source link

Example request: How to use DifferentialEquations.jl as part of the model, especially SDEs? #130

Closed schlichtanders closed 1 year ago

schlichtanders commented 1 year ago

Hi,

I want to model timeseries data using RxInfer.jl in an online manner. I understood that I can use RxInfer.jl directly to build State Space Models. However sometimes I really would like to model time continuously, i.e. using DifferentialEquations.

More specifically, I want to model the system still as stochastically evolving over time, i.e. using Stochastic Differential Equations (SDEs). This confuses me, as then there are two frameworks which model randomness and somehow they need to be brought together in sound ways.

Turing.jl actually has an example of combining Turing's Bayesian Modelling with SDEs: https://turing.ml/dev/tutorials/10-bayesian-differential-equations/#inference-of-a-stochastic-differential-equation They also mention that the extra randomness of the SDE gives problems for NUTs, but they suggest that it still makes sense to do so, and it kind of works.

It would be awesome if something like this is also possible for RxInfer.jl, so that something like in the mentioned Turing.jl example could be build for an online learner on top of RxInfer.jl. This would allow to stochastically model continuous timesteps in online learners.

albertpod commented 1 year ago

Hi, @schlichtanders!

Thanks for checking out the package. There has been a discussion on DifferentialEquations.jl (see https://github.com/biaslab/RxInfer.jl/discussions/56)

Unfortunately, we are currently working on other things for the package, but adding some examples with DifferentialEquations.jl is planned. We will get to it when we can.