rajeshrinet / pyross

PyRoss: inference, forecasts, and optimised control of epidemiological models in Python. github.com/rajeshrinet/pyross
https://pyross.readthedocs.io
MIT License
169 stars 57 forks source link

Derivation of parameters etc. #11

Closed philip-mach closed 4 years ago

philip-mach commented 4 years ago

It would be nice if you could give a method of computing parameters like beta for those who can’t work it out directly from the paper. Using you EX3 adjusted for South Africa, beta = 0.02 is a better fit to the pre-lockdown data but eyeballing is not very rigorous.

Thanks, I am finally getting somewhere with this.

rajeshrinet commented 4 years ago

@philip-mach this is an excellent suggestion. Thanks!

There is now an example notebook on fitting the parameter beta at https://github.com/rajeshrinet/pyross/blob/master/examples/fitParamBeta.ipynb.

philip-mach commented 4 years ago

Thanks. I note though you have built the value Nf into the code so it breaks if the number of cases differs from yours. I pushed a change to my fork that fixes this by putting this before Nf is first needed:

my_data = np.genfromtxt('data/covid-cases/southafrica.txt', delimiter='', skip_header=7)
day, cases = my_data[:,0], my_data[:,2]

# set based on size of case data set
Nf = cases.size

PS: my eyeball must be pretty good; the calculated beta is 0.01946163 vs. the 0.02 I estimated. But still better to do this properly.