I am a beginner in both Julia and Bayesian inference, and I am interested in Turing.jl to learn about both. I am a mechanical engineer who typically works with deterministic ODEs, i.e. given some parameters as input, the solution will always be the same. I often try to fit these input parameters on scarce data (with varying degees of success…), hence I think Bayesian inference will be useful for me.
From the Turing tutorial page (Bayesian Estimation of Differential Equations), I know that this is possible with Turing.jl, using Markov Chains. However, I was wondering if I can also use my own ODE solver in this context, instead of relying on DifferentialEquations.jl as is done in the tutorial. The reason for this, is that the ODEs I work with are rather complex, and I haven’t had the time to implement them in DifferentialEquations.jl (yet…). For now I just ported the code to solve them (from Matlab), so I would be very happy if I can just supply that function (with the parameters as input and the solution to the ODE as output) to Turing.
Any input or a reference to a useful example is very much appreciated. Thanks!
Are you sure you need an ODE solver?
DifferentialEquations.jl is a massive ecosystem that enables even GPU-based Quaternions Solvers…
I think you want to define your own ODE system of equations. Is that it?
What are you trying to do?
Thanks for the replies, and apologies for being so vague. To be honest, I am quite a beginner in the field of Bayesian UQ, so I’m not really sure if the things I want make sense. Let me try to explain it a bit further:
We use a large (coupled) set of ODEs to model some process. There are many (>10) parameters in this model, and some of those we cannot measure direclty, and only have a vague idea about their value. Now we just determine them by fitting the experimental data, but this turned out to be very difficult since the data is scarce and quite noisy.
Unfortunately, my company doesn’t allow me to share details about the model, I think for the present purpose it suffices to say that we have a solver that can find solutions to this system, given the input paramaters:
ODESolver(params) = solution
Would it be possible to feed this model into Turing.jl, together with the scarce data, to infere the most plausible parameter values? I think this would be very similar the the tutorial (Bayesian Estimation of Differential Equations), with the exception that our ODE solver is not written in DifferentialEquations.jl.
That’s a good question.
My intuition says that you only need the return values from your ODESolver to be continuous in order for HMC to take gradients for the logpdf.
I don’t know if a ODESolver inside a Turing model does much more than that.
In any case, I’m not 100% confident on my intuition and would love to hear if I am right or wrong from more experienced folks.
I’ve done a lot of epidemiological Bayesian models using Stan and Stan’s ODE solvers does only that…
Don’t know if this is the case for Turing.jl and DifferentialEquations.jl
Hello, I am performing the Bayesian estimation of some parameters of a system of differential equations using Turing.jl.
But the need to estimate some of the initial conditions has arisen, does anyone know how to do it?
You just consider the initial conditions you need to estimate as part of the parameters that are estimated using Turing.jl, together with other parameters. This works fine.