SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
trackstar
Posts: 27308
Joined: August 28th, 2008, 1:53 pm

Re: Models for Covid-19

March 26th, 2020, 1:38 am

Very nice modeling effort there. Still able to supply data if and when useful.
If data is not that useful on this thread, please advise - fine for me to put it on Pandemic Model thread in OT instead.

Some notes on current state in US: https://www.washingtonpost.com/graphics ... ronavirus/

Selection of percent increase and confirmed cases (CC) in Northeast since Sunday:
Updated as of 7:55 pm EST Wednesday, March 25

New York - +95% 
CC: 30,841

New Jersey - +130% 
CC: 4,402

Massachusetts - +185% 
CC: 1,838

Connecticut - +292% 
CC: 875

Total CC in US: 65,778
Total Deaths: 942

Watching Europe as well. Italy seems (hopefully) to be turning the corner, but Spain is struggling hard.
I do hope that people/countries who are going the lock down route will stay the course.
From what I have read, two weeks would seem to be a minimum for effectiveness, 3-4 weeks would be better.
But I am certainly in the People>> than Economy camp.
No-limit stimulus has problems for sure, but for now just slow things down and learn.
 
 
User avatar
Paul
Posts: 10505
Joined: July 20th, 2001, 3:28 pm

Re: Models for Covid-19

March 26th, 2020, 2:21 am

I've no idea whether it is interesting or not. There are a few subtleties about the nonlinearities in here that are annoying. It might be that all the different parameter regimes (especially [$]\alpha[$] and [$]\beta[$]) amount to the same model just with different time scales. But [$]\beta=0[$] is definitely interesting because then infection-free households stay infection free.

The two cases [$]\beta=\alpha[$] and [$]\beta=0[$] are functionally the same, but with different aggregation. And it's the aggregation that matters because that's what governs the number of hospital cases.
 
User avatar
Herd
Posts: 562
Joined: October 2nd, 2003, 12:48 pm

Re: Models for Covid-19

March 26th, 2020, 8:49 am

Maybe the difference between countries is not small (eg maybe Italy being the most affected is not chance, maybe it’s connected to elderly people living with a child and grandchildren )
 
User avatar
Cuchulainn
Topic Author
Posts: 61609
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Models for Covid-19

March 26th, 2020, 9:54 am

Why not run it through Mathematica? Alan? :-)
I have a C++ model for MSEIR and I can easily adapt it to Paul's "SIR + H" model 
Will Paul  and kats freeze the requirements and deliver me an unambiguous model so that I can set up the new design? A slightly scoped down model is also fine (10 households? etc.)

Do I have a commitment that if I put in the work that I get feedback on possible queries I might have?

Forget BREXIT, let's get this done! All hands on deck!

// I use Boost odeint and Python also has odeint.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Paul
Posts: 10505
Joined: July 20th, 2001, 3:28 pm

Re: Models for Covid-19

March 26th, 2020, 5:09 pm

I'm tinkering with it analytically. I'll write it again neatly next.
 
User avatar
Paul
Posts: 10505
Joined: July 20th, 2001, 3:28 pm

Re: Models for Covid-19

March 26th, 2020, 5:47 pm

This is the full lockdown+hospital model. The version to work on. Only change from previous version is putting in the N parameter to help with scaling.

Independent variable:
[$]t[$] is time.

Dependent variables:
[$]S_i(t)[$] =  susceptible in each household, at home
[$]I_i(t)[$] = infected in each household, at home
[$]R_i(t)[$] = recovered (alive) in each household, at home
[$]H_i(t)[$] = in hospital from each household
[$]D_i(t)[$] = dead from each household

Only the first two sets of these are coupled. So it is not as bad as it looks. And they differ across [$]i[$] only in initial conditions. The equations and parameters do not vary with [$]i[$].

[$]i[$] is a household index, [$]i=1,\ldots,N[$], so there are [$]N[$] households. This means that each household has its own five quantities ([$]S,I,R,H, D[$]). 

There are five ODEs:

[$]\frac{dS_i}{dt}=-\left(\alpha -\frac{\beta}{N}\right) S_i I_i-\frac{\beta}{N} S_i I\qquad[$] (1)

[$]\frac{dI_i}{dt}=\left(\alpha -\frac{\beta}{N}\right) S_i I_i+\frac{\beta}{N} S_i I-\gamma I_i-\delta I_i\qquad[$] (2)

[$]\frac{dR_i}{dt}=\delta I_i+\epsilon H_i\qquad[$] (3)

[$]\frac{dH_i}{dt}=\gamma I_i-\epsilon H_i -\phi(H) H_i\qquad[$] (4)

[$]\frac{dD_i}{dt}=\phi(H) H_i\qquad[$] (5)

Here

[$]I(t)=\sum_{j=1}^NI_j(t)[$], meaning the total population of infected across all households,

and 

[$]H(t)=\sum_{j=1}^NH_j(t)[$], meaning the total number of people in hospital across all households.

Whenever the subscript on a dependent variable is missing it means summed over all [$]i[$].

Only two sets of these ODEs are coupled. 

These are the meanings of the parameters:

[$]\alpha[$] is the usual SIR parameter for susceptible becoming infected, within household
[$]\beta[$] is the usual SIR parameter for susceptible becoming infected, outside household and therefore much smaller than [$]\alpha[$] during lockdown
[$]\gamma[$] represents going into hospital. 
[$]\delta[$] for recovered without hospitalization
[$]\epsilon[$] for returning from hospital.

There is a function here, [$]\phi[$], for deaths in hospital, that we have to specify. It is a function of total number of people in hospital.

[$]\phi\left( \sum H_i\right)=\phi(H)[$]

Solve coupled equations (1) and (2). They feed into (4) and (3) then (5).

The parameter values I used for my second two plots were

[$]\alpha=2[$] 
[$]\beta/N=2[$] for the first plot, 0.2 for the second
[$]\gamma = 1.5[$] 
[$]\delta =1[$] 
[$]\epsilon = 1[$] 

For the [$]\phi[$] function I had

[$]\phi(H) = 0 \;\mbox{for}\;H<1, 2\;\mbox{for}\;H>1[$]

I had ten households, so [$]N=10[$]

For initial conditions I had [$]R_i(0)=H_i(0)=D_i(0)=0[$].

And I had uniformly random [$]I_i(0)[$] between zero and [$]I^*[$]. Then [$]S_i(0)+I_i(0)=1[$]. (I don't know whether changing household size matters.)

In my examples I had [$]I^*=0.2[$].

Notes:

You don't need the third equation, for [$]R_i[$]. It's there because it's in the SIR model, and in case there is the possibility of either reinfection or the recovered passing on the disease. That would require tweaking the model.

Total number of deaths is found by solving

[$]\frac{dD}{dt}=\phi(H) H[$]

Please play around with parameter values and the [$]\phi(H)[$] function. My parameters were not carefully thought out, just used to see it I could get any results at all.
 
User avatar
Cuchulainn
Topic Author
Posts: 61609
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Models for Covid-19

March 26th, 2020, 6:50 pm

Excellent! Thanks
I'll start asap.

This is reasonably benign set of ODEs. The solver sees the coupling so I just write down in C++.

It won't take long to churn out data that we can look at. I wrote my own Excel driver to view all arrays on one sheet. (actually, Excel is then both a plot and a database for post-analysis if need be.).


// 
An initial project estimate is best = 4, worst = 14, most probable = 9 hours. Worst and probable will be lower if I have interpreted the requirements properly.
Last edited by Cuchulainn on March 26th, 2020, 7:08 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Cuchulainn
Topic Author
Posts: 61609
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Models for Covid-19

March 26th, 2020, 7:03 pm

// n/a
Last edited by Cuchulainn on March 26th, 2020, 7:07 pm, edited 1 time in total.
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Cuchulainn
Topic Author
Posts: 61609
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

Re: Models for Covid-19

March 26th, 2020, 7:06 pm

Please play around with parameter values and the ϕ(H)ϕ(H)
 function. My parameters were not carefully thought out, just used to see it I could get any results at all.


I can run multiple parallel versions of my solver, each invocation having its own set of randomised parameters if necessary (Version 2, but first get sequential version). What are the conclusions to draw from the output (is there an 'optimal outcome?)
http://www.datasimfinancial.com
http://www.datasim.nl

Every Time We Teach a Child Something, We Keep Him from Inventing It Himself
Jean Piaget
 
User avatar
Paul
Posts: 10505
Joined: July 20th, 2001, 3:28 pm

Re: Models for Covid-19

March 26th, 2020, 7:26 pm

Please play around with parameter values and the ϕ(H)ϕ(H)
 function. My parameters were not carefully thought out, just used to see it I could get any results at all.


I can run multiple parallel versions of my solver, each invocation having its own set of randomised parameters if necessary (Version 2, but first get sequential version). What are the conclusions to draw from the output (is there an 'optimal outcome?)
That we don't all die a horrible death! That lockdown happened in time? But seriously...

I would think to start find a set of parameters that gives something interesting and then vary N from 1 up to 1000, say. Because this is the part that isn't clear to me whether it does something or not. This is the aggregation issue.

There are two interesting things about this:

1) The lockdown aspect. How restrictions vary results. I am not sure whether aggregating many households is the same as zero lockdown but with different parameters and thus timescales. It is clear that beta=0 is special, but even beta tiny might not be interesting.

2) The deaths dependency on number in hospital. This is interesting but trivial (since it is not coupled to anything else). But obvs not trivial in terms of knowing the phi(H) function.
 
User avatar
trackstar
Posts: 27308
Joined: August 28th, 2008, 1:53 pm

Re: Models for Covid-19

March 26th, 2020, 7:34 pm

Just thinking out loud, but would developing a credit default model where default=Hospitalization (or death) be useful?

Besides having a well elaborated set of models to chose from, with good literature, It also might help to evaluate systemic effects.

Eg too many defaults means hospitals are overwhelmed (or death count is getting very high) and there will be cascading effects through the “credit” system at that point.
 
User avatar
Paul
Posts: 10505
Joined: July 20th, 2001, 3:28 pm

Re: Models for Covid-19

March 26th, 2020, 7:38 pm

That's what these models are. See Wilmott & Orrell.
 
User avatar
trackstar
Posts: 27308
Joined: August 28th, 2008, 1:53 pm

Re: Models for Covid-19

March 26th, 2020, 7:44 pm

That's what these models are. See Wilmott & Orrell.
very good. carry on!
Last edited by trackstar on March 26th, 2020, 8:05 pm, edited 1 time in total.
 
User avatar
Paul
Posts: 10505
Joined: July 20th, 2001, 3:28 pm

Re: Models for Covid-19

March 26th, 2020, 7:49 pm

For years I've been telling quants that they can learn from math biology. Looks like they are finally listening! Of course, they will only learn from the tiny part of math biol that's about epidemics, they'll ignore the rest. What happened to enquiring minds?
 
User avatar
Paul
Posts: 10505
Joined: July 20th, 2001, 3:28 pm

Re: Models for Covid-19

March 26th, 2020, 7:50 pm

Cuch, I'll keep playing around with aggregation analytically.
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


Twitter LinkedIn Instagram

JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...


GZIP: On