Help in creating a Beta-Dirilecht State Space Model

I am trying to extend the compartmental SIR model such that it can simulate a timevarying transmission rate ( due to government intervention,etc). I have a sample implementation in R here and I am trying to port it to pymc3.

After I define the priors, how exactly do I go about specifying the model.
Do I loop over all time steps as shown in the R implementation and try to find a solution to the differential equations using the RK4 method. Then update the thetas modelled as a latent markov process.

I am getting a bit confused with the way I can approach this problem. What I essentially need is some direction to how I can approach this. Any additional resources would also be super helpful

1 Like