ODE inference with varying start conditions

Dear all,

I am new to pyMC3 and want to use it to infer parameters in an ordinary differential equation (ODE) in this case a kinetic equation describing the evolution of chemical species during a chemical reaction. My plan was to use pyMC3’s ODE API for this purpose.

This API is based on the assumption that starting conditions for solving the ODE are always the same, which means that one obtains as result a matrix of type (n_times x n_states). In my case n_states is the number of chemical species involved in the reaction.

If one wants one can interpret the timings as X values for the model and the states as Y values. This can be perfectly modeled by the ODE API in pyMC3. But my case is a bit more complicated. I have addtionall X values, namely the starting conditions for the ODE were varied like for example pressure and temperature during the reaction.

My question is now, how to tell pyMC3 that he has to evaluate for every MC sample the ODE (the model) several times, namely for every combination of starting conditions occuring in the training data?

In the end this should result in a three dimensional matrix of shape (n_starting_conditions x n_times x n_states) considered in the likelihood function instead of the two dimensional one covered in the example in the documentation.

Best,

Johannes

Hi @jduerholt , did you make any progress on this?