Looking for reference on doing numerical solving of a system of SDE's in python. I am trying to model a stochastic SIR model:
$$\begin{cases} dS = -\beta SIdt - \sigma SIdW \\ dI = (\beta SI - \gamma I)dt + \sigma SIdW \\ dR = \gamma Idt \end{cases}$$
I have been using a python package called SDEint, however, I am running into errors of getting negative sample paths which should not occur.
I have posted my code here: Stochastic SIR using SDEint python package
I have thought of trying to build my own solver but I am not terrible proficient in python. Any references to examples or literature that will help me in constructing my own solver is appreciated.
Additionally, perhaps there is a way to parametrize the system to avoid getting negative values in the sample paths. Such a parametrization is mentioned here How is the simulation done of the black scholes model?