Welcome back to Modeling Complex Systems.
This will be our final video for Module one.
We have reached the end of our module on Dynamical System.
I just wanna use this video to
talk a little bit more
about both, the very start of the class.
How do we model a system as a dynamical system?
How do we model a problem?
And some things to keep in mind
once we have a model and we start analyzing it.
What are the potential sources of error?
So I wanna divide this video in three parts,
to think about modeling as a recipe.
So we're gonna have the ingredients,
this is how we start our model.
The preparation, which is really how we run our model,
put everything together.
And finally, how to present our beautiful dish
and what are the possible sources of error.
Because even the best models,
if not interpreted correctly, can be problematic.
So the ingredients, we've talked a lot about time,
in these dynamical systems.
So time could be discrete, we have discrete models.
It could be continuous.
We could even think about models that are static.
We haven't done so yet but we will,
as we look at statistical models, for example.
So first is to pick what notion of time
best represent the problem you're interested in.
Then we also wanna think about space.
Similarly, space can be continuous or discrete.
It could also have dimensions.
This will all become important.
When I say dimensions, especially,
are we in 2D or 3D?
Are we on a network?
This will all become important,
mainly as starting with the second module on structure.
Then the key part of this modeling as representing a system,
as building a representation of a system,
is to think about what are the important parts
of this system.
So in terms of epidemic models, we knew it was
having both susceptible and infectious individuals.
That was the key part, was the separation of a system
into boxes and following those boxes which represent
parts of different nature
and asking how those different boxes
and parts are interconnected.
Then we wanna ask questions
about whether the system is closed or open.
So when we were doing compartmental models,
it was about whether we had arrows coming or going
to the outside.
Or whether all arrows started in a box, went to another box,
meaning that we had a closed system
and some conserved quantity, often.
Then we need to think about the rules
and whether or not we feel like it's important
to have stochastic, meaning,
rules with an element of randomness.
So if you're flipping coins,
the way we did a little bit in some pseudo code,
that was
stochastic models.
A set of stochastic rules,
where we had to draw random numbers between zero and one.
Otherwise deterministic rules can give you something
like ordinary differential equations.
Those ODEs are deterministic by their nature.
Tell me where I am and I'll know exactly where I'm going.
That's what the differential equation is telling me.
So that's deterministic.
To compare, again, one good analogy between the two,
is that you can run the same model
with the same initial condition twice.
If it's a stochastic model,
you're not gonna get the same time series,
the same solution.
If it's deterministic,
your initial condition determine the future
and so you'll get the exact same solution,
even if you run it more than once.
Then there are other questions that the system have memory.
Are we dealing with a Markovian, meaning, no memory.
The present dictates the future.
Are we dealing with non-Markovian models,
where there might be some memory
and we have to take that into account somehow?
Those were the more general questions.
But really, when we think about how to run a model,
the textbook has this great
set of principles that's easy to remember, IOU.
IOU a model.
And the way I will give you that model,
is by initializing it, observing it and updating it.
So initialization means to define the variables
of the system.
What do you care about and what is their initial state?
So that could simply be a number
of initially susceptible individuals
and a number of officially infectious individual.
And that sets the initial state of my system.
Could be a number of predator and a number of prey.
Then we have to define what we observe.
How do we monitor the system?
What do we wanna measure,
as the system runs, as the model runs?
And then once we've done that,
we can actually update the system.
We start with our initial state.
We apply the set of rules that we've defined
in the previous step
and then measure what we wanna observe.
Apply the set of rules again,
measure what we wanna observe,
apply the set of rules, measure what we wanna observe,
until we have enough data
and decide that we're done.
So this is just a good mnemonic trick to remember
the importance of these three different steps.
You do wanna play with different way to look at the systems.
So different things to observe.
You wanna play with different initial conditions.
So the model as a set of rules, is not always enough
and you need to think of the other step
of preparation as well.
And then finally, with this presentation,
meaning, we have a model,
we are measuring something and often we either wanna
compare it to data or we just wanna communicate the results
of our model because we think it's insightful
and tells us something about the real system
we're interested in.
So when we think about presentation, really,
what we mean is,
what are the possible problems at this stage?
What are the possible sources of error
that we need to be curious about?
So when you present your model,
you wanna be transparent about everything that came before.
What assumption and idealization did you do?
What did you measure and observe?
How did you update your model?
But there are a whole set
and I'm putting them up all on screen right now.
There are a whole set of potential sources of error,
even once you've been transparent.
So let's say your model, you know,
doesn't fit well with data
or doesn't capture the intuition you want it to capture.
It could be model error.
It could be that in these early stages of the system,
you made a mistake, you ignored something,
you made an assumption or an idealization,
that you shouldn't have made.
So any problem in the specification of the model,
we would call a model error.
One very common source of error is, is due to parameters.
You might have the right mechanisms in the right model
but the bad values on these mechanisms,
maybe the rules of the model should change
in time and they do not.
Or maybe you simply didn't measure something
like birth rate of the prey, well enough.
So that's definitely possible.
So often what you'll wanna do, is test
a whole range of parameter,
which we often call a parameter sweep
or sensitivity analysis,
to see how much of the same behavior you get
when you vary those parameters.
And then at least you'll know how important measuring them
in practice will be.
Or selecting them correctly.
The third source of error that I have on there,
is measurement error.
It is possible that the model is right
and it is the world that is wrong, right.
Maybe you're comparing to data that just doesn't exactly
capture what you wanted to capture.
We often look at
epidemic models by comparing them to what we call,
influenza-like illness.
So we think of flu as a disease that we wanna forecast.
It has an important disease burden.
And we have those well-defined flu season
but it is very hard to diagnose.
So the proxy that we're using,
is these influenza-like illnesses,
which is not just flu, it's a bunch of other things.
So we're comparing about something that is super noisy.
So the things that we're comparing against
are not measured right.
That could also be a source of parameter error,
if we're not measuring those parameters right.
So sometimes a model is right
and it is the world that is wrong.
Our fourth category here, is discretization error.
That is super common.
Most complex systems are interesting because they're
created by a collective of parts.
But those parts are often discrete, right.
Discrete predators and prey, discrete number of people.
But most of our model are gonna assume continuous
mathematics, just because it is a powerful set of tools.
If we can use, you know, differential equations
over continuous variable, that's a powerful tool to use.
And unfortunately, reality of our system is often discrete.
The same goes with data.
Our model is gonna give us
prediction of predator or prey over time,
in continuous time.
But the data might just come
from observations that are monthly.
Those observations are gonna have some measurement error
but they're also gonna have this discretization error,
that we're only observing them once in a while
and putting a lot of data together, bending them over time.
So that's something to keep in mind.
And finally, as we saw with chaos theory,
there can be numerical errors.
The model might be a little unstable,
so it might be hard to solve for some fixed points.
Or it could be sensitive to initial conditions,
such that, even the best algorithm won't give you
a good prediction
of which you should expect from that model.
And then it becomes hard to compare reality
with those noisy numerical predictions.
So, you know,
these are meant to just be things to keep in mind
as you start creating your own models.
Ingredients, preparation, the IOU mnemonic trick
and the presentation.
But we're gonna keep applying the same recipe.
We're gonna see other sources of error, other ways to model.
This is only the beginning.
It is the end of our first module.
But starting next week, we'll be talking about structure.
We'll have two modules on structure.
The first one on Cellular Automata.
And the second module on structure, module three,
will be on networks.
So this whole step, this next step, I should say,
starts next week.
I'm super excited to start
talking a little more about structure.
It is just, if not more interesting than dynamics.
And eventually we'll put all of that together
and we'll be creating really, really cool models.
So I'll see you soon.