Speed up sampling of forced ODE model

Hi!

You tried the stiff solver already?

Currently you are using the defaults for the tolerances, so have a look at my post here:

The default tolerances are quite conservative. So it is important to adapt the absolute tolerance to a meaningful value (the relative tolerance may also be increased, but from experience to a lesser extent).

Also, if I see that right, then you can just vectorize your for loop for the likelihood. If you write normal_lpdf(I | I_int, sigma) you get exactly the sum which you are forming afterwards.

I hope this helps.

Sebastian