In the last video we saw to go
from a discrete SIS model to a continuous model.
And here what I'd like
to show is the power of the continuous formulation.
Just because once we write it
as differential equation, models are way easier to solve
in a way because we unlock the power of calculus
and of a lot of mathematics.
The SIS model is also interesting
because it's the simplest model we've seen so far.
We've discussed some more complicated ones
without conserved population
and with a lot more than two states.
But this one is interesting because we took the complexity
of disease spread and reduced it to two boxes.
Meaning we have a human population that we put
into two boxes that we call S and I,
depending on whether individuals are susceptible
or we put them in the S box or infectious
we put them in the I box.
Then we had two arrows for two mechanisms.
There's a mechanism for infection.
So as individuals go to "I"
and mechanisms for recovery.
To write down the equations,
we did a lot of approximations and idealizations.
We assume, you know a fully connected population,
a mean field approximation.
We saw how the time derivative
of S which I'm often gonna write S dot,
this is a notation from Newton,
which I like 'cause it's just a little simpler.
The dot just means time derivative of S.
Could be simply written as minus beta SI
by assuming very small time steps,
gamma of I, here it's just an average.
We're tracking the average state of the system.
That's what this differential equation is doing.
If you look at different places,
we're gonna be some reading,
doing some readings about some of these models.
You might also see stuff like
minus beta SI over N plus gamma I.
This is just a different formulation,
really it is beta over N is just using different units.
Beta over N is a like shifted transmission rate.
And the question is whether your beta is formulated
as a per contact, in which case you don't need the over N
or as an overall transmission rate in which case you you do.
So there's different ways
and again, I'm showing this just
because I wanna stress that there's no one way
to write an equation for some of these models.
It depends on what units you're using,
what approximations you're doing.
But they're not more valid one than another really.
We also saw, once you go through the process
of writing those equations what's useful is to think
of it as writing one equation
per compartment per state in the system.
And then you have some negative terms
for every mechanisms that leaves.
So every arrow that leaves your box needs a negative terms
and that's this minus beta SI here.
And every mechanism that enters your box,
anything that flows in the system
needs a positive term in your equation.
And so we could also write the "I" dot equation very quickly
by realizing that everything that leaves S has to enter I.
So I need a plus beta SI term
and everything that leaves "I" was entering S.
So my gamma "I" is now negative 'cause it's leaving.
There's another way to realize
how easily you can write this equation
for "I" dot given S dot, which is the fact
that we here have a conserved population.
We assumed a closed system,
meaning that there's no arrows flowing in
or out of our boxes into the rest of the universe.
So it's a closed system.
So I have S plus I equal to N for all times.
And if I take the time derivative of this.
Well I get S dot plus I dot,
the derivative is the linear operator.
I can just sum my derivatives.
I get N dot which really is the derivative
of a constant with zero.
The number of people
in the system is not changing in time.
Again, there's nothing flowing in or out.
So this gives me that S dot
has to be equal to minus "I" dot.
So I know I can just flip all terms.
The reason why I'm highlighting this different perspective
on it is because whenever you have a conserved population
even if you have like 20 different states,
you know that the sum of all your differential equations
should be equal to zero
'cause nothing's leaving the system or entering it.
And so that's a very useful sanity check
to make sure that you wrote your equation
in a correct way is
whether do they respect your conserved population
do they sum to zero?
So that's useful.
The formulation in terms
of differential equation is great to do things
like flow diagrams, which we did for discrete models.
Really those differential equations were
in calculus were often just like given equations
and we're told to solve them.
What they mean is, you know
what is the speed of the system at any given point.
So these S dot and "I" dot are plotting this flow diagram,
give me what S is, I'm gonna know what "I" is,
it's gonna be N minus S
and I'm gonna know what my speed is in the S space
and the I space and it's very easy to plug those diagrams.
They're giving me the direction of the system.
And often what we're gonna care about are is
where is this system gonna end up?
And what does that mean is
when are S and I gonna stop moving?
So that's what we call a fixed point
or an equilibrium point.
The term equilibrium makes a little more sense
in classic physics model.
If you think of the pendulum
which is damped and eventually stops moving
now it's at equilibrium, it's fixed.
Here it's sort of a what we call a dynamical equilibrium.
So the quantities S and I are gonna stop moving
eventually they're gonna become fixed in time.
But underlying this there are still people
getting infected and recovering.
It's just that the number
of expected infection is gonna manage the number
of expected recovery so that S and I are fixed.
So how do we find those fixed points?
Well, it's the coordinates S and I such that our derivative
in time is equal to zero, things are not moving.
So I'm looking to solve this equation.
Well, and if I go really quickly,
I can cancel out my "I",
I just have minus beta S plus gamma equals zero.
So that gives me S star.
I'm often gonna use star to denote dynamical equilibrium
and equal to gamma over beta.
So I can do a little thought experiment.
Where does my system end up?
This S star for different diseases
with a whole range of different beta from zero to infinity.
Well, at infinity I'm gonna start very close to zero, right?
Gamma over beta goes to zero and beta goes to infinity.
And that makes sense.
People are always gonna recover
but if they get infected infinity fast,
they're not gonna stay in the state for very long.
So the larger beta is the closer I am
to this S star equal zero
and then it's gonna do something like this
and blow up as better approaches zero.
Well that's the problem because I know that S
has to stay between zero and N.
So there's a point here where my solution is crossing N
and that's a big problem.
So really the problem is that I went too quickly
when I canceled out my "I" terms.
I is not a constant here,
it's another variable in the system.
It's just that I know its value, it's N minus S.
So if I rewrite my equation like this,
I'm highlighting the fact that I expect a quadratic term.
I have a plus beta times S squared.
So it's a quadratic equation.
So I know that I have two solutions to this state
and the other solution is actually really easy to see.
So I'm gonna write this as S1 star
with my gamma over beta, but I have another solution
which is S2 star, which is equal to N.
And this is matched with I2 star solution
equal to M minus S equal to zero.
So that's my disease free state
and of course that's a solution.
Of course, if I don't have anyone infectious in the system,
I know that I'm a steady state.
There cannot be infections without infectious individual
and there cannot be recovery without infectious individuals.
Okay, so now I have this interesting point
where my two solutions cross
and what I wanna know is really what's going on,
which state is my system going to go to
if I run a simulation of it
or if I integrate my differential equation?
Both of these approaches we're gonna see in the next videos.
But here I wanna try and make a prediction.
What's state, the red state which is bad or the blue state
which is good without disease, is my system going to go to?
So let me just take a picture of this here
and we're gonna do what we call a stability analysis.
I don't know why my picture didn't work
Just, I'm looking at S star, oops,
as a function of different betas
and I have a S1 star equal to gamma over beta
and a S2 star in blue
equal to N.
Okay, well what's stability analysis means is I want
to put myself in one of those fixed points
and asked if I move away from it,
which direction am I gonna move in.
And so if I'm at S equal N which is a fixed point
and I introduce a little bit of infectious individual,
is my derivative gonna be positive?
Meaning that I go like down from the blue state,
do I go back up to the good disease free state
or do I go back further down to the red line.
Stability is gonna help us understand
what the impact of introducing a disease is gonna be.
So what I like to do in this case is to go back
to our differential equation.
And I am gonna ask if I introduce the disease
for every infectious individual that I introduce
what is gonna be the rate of change of S dot?
So really I'm looking at S dot over I.
So this is a useful perspective to take
and this is minus beta S plus gamma.
Okay.
So if I'm at the fixed point S2 star,
this is minus beta N plus gamma.
And that thing can be greater or smaller than zero.
And I want to know which is it for a given disease.
So often people are gonna summarize this equation,
this question really as the basic reproduction number.
And if you've followed some of the meatus
especially early on in the COVID outbreak,
you've probably heard this phrase before.
So my question here becomes is this number R0 which
in this case is equal to beta N over gamma,
is it greater than one?
So if it's smaller than one,
so if beta N over gamma is smaller than one,
that means that this equation here is positive.
So that happens, let's say if gamma's too big,
beta N over gamma is gonna be smaller than one.
Or if beta is too small.
So if beta is too small, what do we have?
We start at the blue state here,
we move a little bit away from it,
we go back up 'cause that's beta is too small.
This our equation is gonna be positive.
Our S dot over I is gonna be positive.
If beta is greater and is big enough
such that beta N over gamma gonna be greater than one,
then our S dot over I is gonna be negative.
And as we move away from the disease free state,
we collapse down to the red curve.
So this line here is where our R0 is equal to one.
That's where our two solution meet.
And that's often called the epidemic threshold.
Meaning that we can use this little model to try
and determine whether our disease is gonna take
over the system or not.
And that's a simple analysis.
We look for fixed point, we look for their stability.
It's nothing too complicated.
But if you can go through it,
really this is at the core,
this is state-of-the-art disease modeling.
It's at the core of our understanding of diseases.
That's why early on people were so focused
on measuring this basic reproduction number, R0,
there are movies about it.
So really we're already,
in tools that are super useful
in helping us understand the complexity of the real world.
If we care about the time evolution, like, okay
I know I'm gonna go to the red state, I wanna know how fast,
what is my evolution, my time series gonna look like?
Then we might turn to different tools, then analysis.
We might look at numerical integration
which we're gonna see next.
If we want to look at the impact of randomness
then we might look at numerical simulations.
And we're gonna see that too.
But we really can't underestimate how important it is
to just look at the differential equation
and try to get some mathematical insights
from their basic structure.
So that's a full story.
That's how we understand disease spread to this day.
And I hope it's useful in illustrating the power
of modeling even when we use simple toy models.
So I'll see you on the next ones
for some more numerical tools.