# [NB] The SIR Model for Spread of Disease

Posted 1 year ago
13935 Views
|
21 Replies
|
14 Total Likes
|
 MODERATOR NOTE: coronavirus resources & updates: https://wolfr.am/coronavirus
Answer
21 Replies
Sort By:
Posted 1 year ago
 Why, if the average recovery time is 14 days, does this imply that on average one third of the infected population recovers?
Answer
Posted 1 year ago
 Sorry, that was a typo. I will see if I can fix the notebook text.
Answer
Posted 1 year ago
 I think I fixed it.
Answer
Posted 1 year ago
 The statement is still incorrect. In the model with these parameter values, all the susceptible individuals get infected and all recover. If the recovery rate is fast enough, R0 = b N / k = b / k will be less than 1 and the infection will die out before everyone gets infected. The exact value can be worked out from the equations in Brauer.
Answer
Posted 1 year ago
 Sure, but why are the values I am using incorrect? I am just using example values (which anyone can vary to experiment with this model?)
Answer
Posted 1 year ago
 I see the difficulty now. I was interpreting the statement "Here we assume that the average recovery time is 14 days, which means that, on average, 1/14th of the infected population recovers” too broadly, that is, I was assuming you meant the total number of infected and not the current number of infected.What you have is indeed correct. Sorry for the confusion.
Answer
Posted 1 year ago
 The sentence would be clearer if it would say: "... 1/14th of the infected population recovers every day:"
Answer
Posted 1 year ago
 No, this is an instantaneous rate, not a daily rate.
Answer
Posted 1 year ago
 It has to have units of recoveries/time, and by design the time units are days.
Answer
Posted 1 year ago
 Yes, the units are day^-1, but the fraction of infected that recover in a given day is the integral Integrate[k i[t], {t, t1, t2}] / i[t1] where t2 - t1 = 1 and i[t] is the solution from NDSolve, is not necessarily exactly 1/k.
Answer
Posted 1 year ago
 What about if the Recovery equation changes to something like: equationR = r'[t] == (1 - w) k i[t], where w = a "death" parameter, such as w = 0.005? Then, DSolve[equationR, {r[t]}, {t}] gives: r[t] -> C[1] + Inactive[Integrate][(k i[K[1]] - k w i[K[1]]), {K[1], 1, t}]
Answer
Posted 1 year ago
 Yes, I think this basic set of differential equations can be extended in many ways to make it more useful and precise. It would be interesting to see what you can do with it!
Answer
Posted 1 year ago
 -- you have earned Featured Contributor Badge Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!
Answer
Posted 1 year ago
 How do I calculate b from real data?Here are the cases the begin of infecteds in São Paulo Brazilian State data = {1,1,1,2,2,2,2,3,6,10,13,16,19,30,42,56,65,136,152,164,240,286,396,459,631,745,810}; Clear[a, k]; NonlinearModelFit[data, a Exp[k t], {a, k}, t]["BestFitParameters"]  {a -> 2.35641, k -> 0.219352} It's somehow related to k?
Answer
Posted 1 year ago
 I am not sure how to best calculate b and k from actual data. This model is very simple and the real world is quite complex (different spreading rates for different people and places, and time-dependent spreading rates due to changing policies). It may be possible to get a fit for a current situation, but this fit probably has limited predictive value.This model does have value to understand how changing the parameters affects the spreading of infectious diseases.
Answer
Posted 1 year ago
 I was wondering if you could change the WindowSize option to Automatic for this notebook. I downloaded it from WolframCloud and it displayed in Full Screen mode, making it impossible (AFAIK) to resize it. I was finally about to open options dialog and reset the WindowSize option. Would others have the same issue?
Answer
Posted 1 year ago
 Can this be replicated with discrete time?
Answer
Posted 1 year ago
 I think so. But I have not tried it.
Answer
Posted 1 year ago
 II tried to replicate it in discrete time but RSolve/RSikvevakye couldn't solve it. Attachments:
Answer
Posted 1 year ago
 I've just finished making a stochastic solver for compartmental models, and will be making a post to Community later this week.
Answer
Posted 1 year ago
 I would suggest either RecurrenceTable or an explicit loop for obtaining a numerical solution in discrete time steps. The system might not be amenable to exact analytic results such as would be provided by RSolve.
Answer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments