Page 1 of 2

Models for Covid-19 - analytics

Posted: March 26th, 2020, 9:18 pm
by Paul
Continuing on from the numerical analysis thread...

Can solve for [$]I_i[$]:

[$]I_i(t)=e^{-\lambda t}\left( \lambda \int_0^t e^{\lambda \tau}S_i(\tau)d\tau-e^{\lambda t}S_i(t)+S_i(0)+I_i(0) \right).[$]

And then

[$]\frac{dS_i}{dt}=\left(\alpha-\frac{\beta}{N} \right)S_i\left( S_i- \lambda \int_0^t e^{\lambda (\tau-t)}S_i(\tau)d\tau -e^{-\lambda t}(S_i(0)+I_i(0))\right)\\ \qquad + \frac{\beta}{N}S_i\left( S- \lambda \int_0^t e^{\lambda (\tau-t)}S(\tau)d\tau -e^{-\lambda t}(S(0)+I(0))\right). [$]

Observe where there are and aren't subscripts.

When [$]\beta=0[$] there is total lockdown and you can integrate each [$]S_i[$] a bit. (*) Then you need to sum over all [$]i[$] and you'll get [$]I[$] which feeds into the [$]H[$] and [$]D[$] equations. Messy. So that's solve first then sum over [$]i[$].

When [$]\alpha=\frac{\beta}{N}[$] there is no lockdown. You can sum the [$]S_i[$] equations over all [$]i[$] and get the same result as in (*) but for the sum instead of individual households. So that's sum over [$]i[$] then solve. (The other way around from above.)

For other cases you can't solve/sum in either order because of the [$]S_i^2[$] term.

Re: Models for Covid-19 - analytics

Posted: March 26th, 2020, 9:49 pm
by Paul
Or in two lines if I was able to concentrate(!):

[$]\left( \frac{S_i'}{S_i} \right)'+\lambda \frac{S_i'}{S_i}=\left(\alpha-\frac{\beta}{N} \right)S_i'+\frac{\beta}{N}S'.[$]

So

[$]\frac{S_i'}{S_i} +\lambda \ln(S_i)=\left(\alpha-\frac{\beta}{N} \right)S_i+\frac{\beta}{N}S +c_i,[$]

where

[$]c_i=\lambda \ln(S_i(0))-\left(\alpha-\frac{\beta}{N}\right) \left(S_i(0)+I_i(0)  \right)-\frac{\beta}{N}\left(S(0)+I(0)  \right).[$]

From this

[$](\ln(S_i/S_i(0)))'+\lambda \ln(S_i/S_i(0))=\\ \qquad\left(\alpha-\frac{\beta}{N} \right)S_i+\frac{\beta}{N}S-\left(\alpha-\frac{\beta}{N}\right) \left(S_i(0)+I_i(0)  \right)-\frac{\beta}{N}\left(S(0)+I(0)  \right).[$]

Which can (almost) be solved for those two extreme cases.

Re: Models for Covid-19 - analytics

Posted: March 26th, 2020, 11:15 pm
by Paul
PROBABLY ERRORS IN ALL THIS

Simple case: [$]n[$] households infected the same [$]S^{(1)}[$] and the rest uninfected [$]S^{(0)}[$].

[$](\ln(S^{(0)}))'+\lambda \ln(S^{(0)})=\\ \qquad\left(\alpha-\frac{\beta}{N} \right)S^{(0)}+\frac{\beta}{N}\left(nS^{(1)}+(N-n)S^{(0)} \right)-\alpha.[$]

[$](\ln(S^{(1)}/(1-I^*)))'+\lambda \ln(S^{(1)}/(1-I^*))=\\ \qquad\left(\alpha-\frac{\beta}{N} \right)S^{(1)}+\frac{\beta}{N}\left(nS^{(1)}+(N-n)S^{(0)} \right)-\alpha.[$]

Rescaling [$]S^{(1)}=(1-I^*)\bar{S}^{(1)}[$] so that both (new) [$]S[$]s start at 1:

[$](\ln(S^{(0)}))'+\lambda \ln(S^{(0)})=\\ \qquad\left(\alpha-\frac{\beta}{N} \right)S^{(0)}+\frac{\beta}{N}\left(n(1-I^*)\bar{S}^{(1)}+(N-n)S^{(0)} \right)-\alpha.[$]

[$](\ln(\bar{S}^{(1)}))'+\lambda \ln(\bar{S}^{(1)})=\\ \qquad (1-I^*)\left(\alpha-\frac{\beta}{N} \right)\bar{S}^{(1)}+\frac{\beta}{N}\left(n(1-I^*)\bar{S}^{(1)}+(N-n)S^{(0)} \right)-\alpha.[$]

Two coupled ODEs.

Re: Models for Covid-19 - analytics

Posted: March 28th, 2020, 4:30 pm
by Paul
Random thoughts:

Is it better to have simpler model for in-household infection? Integers? Or assume everyone infected? So only two types of household? Depends on timescales (in-house and outhouse).

In our household only one person goes out to shop. Suggests to me that there is an optimum household size. (Will depend on how many currently infected.)

Re: Models for Covid-19 - analytics

Posted: March 30th, 2020, 6:50 pm
by Cuchulainn
Random thoughts:

Is it better to have simpler model for in-household infection? Integers? Or assume everyone infected? So only two types of household? Depends on timescales (in-house and outhouse).

In our household only one person goes out to shop. Suggests to me that there is an optimum household size. (Will depend on how many currently infected.)
Does this mean that you can set [$]N=2[$]? 

BTW is [$]I^*[$] an equilibrium value?

Re: Models for Covid-19 - analytics

Posted: March 30th, 2020, 7:47 pm
by Paul
Am still working on integers!

That was the initial infection in a household. 

Re: Models for Covid-19 - analytics

Posted: April 2nd, 2020, 8:41 am
by Cuchulainn
I find this canonical output intuitive. The kind of behaviour to expect?

Image

Re: Models for Covid-19 - analytics

Posted: April 5th, 2020, 1:19 pm
by ikicker
I'm better with Google than I am with Lambda calculus. Mathematics Association of America: solution

I found this chart: Image

It expresses in terms of fractions of the population:

s(t) = the susceptible fraction of individuals,
i(t) = the fraction of infected individuals, and
r(t) = is the fraction of recovered individuals.

They solve using Eulers Method for solving Systems

You can use a solver to solve for the max{i(t)}

Re: Models for Covid-19 - analytics

Posted: April 5th, 2020, 3:25 pm
by Cuchulainn
The problem with Euler'e method is that [$]\Delta t[$] must be very small for stiff, nonlinear systems, Just use off-the-shelf solvers.

I hope they don't put it into production! The authors should have included a health warning.

Still, it's a very nice post :-)

Re: Models for Covid-19 - analytics

Posted: April 5th, 2020, 5:12 pm
by Paul
I'm better with Google than I am with Lambda calculus. Mathematics Association of America: solution

I found this chart: Image

It expresses in terms of fractions of the population:

s(t) = the susceptible fraction of individuals,
i(t) = the fraction of infected individuals, and
r(t) = is the fraction of recovered individuals.

They solve using Eulers Method for solving Systems

You can use a solver to solve for the max{i(t)}
The problem with all of these is not solving them. (If I can do it then anyone can!) It's in knowing which is the right model. Almost all of these type of models give the same curves. 

Some (as the ones considered here) have more dependent variables to capture more features. And anyone can play that game, make the model more complex, interesting, etc. But is it more realistic? Probably not. 

We don't know the parameters for any of these models. We don't even know if we can believe any of the data.

Re: Models for Covid-19 - analytics

Posted: April 5th, 2020, 8:00 pm
by Cuchulainn
Most scientists are probably more comfortable with ODEs, so they add more dependent variables. Sometimes you see extra independent variables for age etc. and you get 1st order pdes.
The underlying maths is  also kinda basic, no?

Re: Models for Covid-19 - analytics

Posted: April 5th, 2020, 8:02 pm
by Cuchulainn
We don't know the parameters for any of these models. We don't even know if we can believe any of the data.

How many [$]$$$$[$] is being spent on this research??

Re: Models for Covid-19 - analytics

Posted: April 6th, 2020, 11:10 am
by Cuchulainn
If anything, this should be viewed as a dynamical system and not as  a simplisch set of ODEs. There'not not much you can ask ODEs to do.

https://en.wikipedia.org/wiki/Dynamical_system

Re: Models for Covid-19 - analytics

Posted: April 6th, 2020, 12:52 pm
by Cuchulainn

Re: Models for Covid-19 - analytics

Posted: April 10th, 2020, 4:34 pm
by zeta
Wolfram fans might like his analysis from a stream last month : https://www.wolframcloud.com/obj/s.wolfram/Published/COVID-19-Livestream-March-24.nb

The last plot is particularly telling ..