Please help (I got stuck for several months)

Hello All,

I have shared my problem in stan forums, but no reply yet!! I appreciate your attention.

I got stuck in my problem for several months. Unfortunately no help so far, I approached several people, stan developers, and people who published papers.


Hi there!

I had a quick go at this here: Interpolation example · GitHub. You should be able to run the script with python in a python virtual environment with a newish cmdstanpy installed.

I had to do a bit of creative interpretation in order to make a runnable example and I have no idea what the results are meant to look like or what is being modelled, so please treat with caution!

The main thing I wanted to get across is that the ode_* functions with variadic signatures (as opposed to the integrate_ode_* ones that you used in the original post) let you use meaningfully named variables and avoid some packing and unpacking.

Anyway I hope it helps!

1 Like

Hi Teddy,

Thank you so much for your reply.

It is kind of exactly what I need, If I could modify it with function sir instead of vector sir. Since sir function just accepts x_i and x_r as integers and real data, not a vector . Then If I could define z in the data and transformed data block. Do you have any idea how?

Btw, I am getting an error by running your code in colab. It is finishing the chain but shows error then:/


Hi again! I think input from someone with better knowledge of the specific modelling problem than me is probably needed here. I left out the x_r and x_i inputs as they weren’t used in the original example (x_i was empty and x_r was a copy of Z), made the sir function return a vector because this is what the function ode_rk45 requires and made z a data variable to copy Z from the original example. It could be that details of the problem make it better to go with integrate_ode_rk45 but I can’t really tell.

On the other hand I can definitely help with getting my example to run without errors! I left some comments on the github gist that should help get started.

1 Like

Hi @Teddy_Groves1

I see. Thanks a lot! It was helpful!