Day 220: Modeling the spread of COVID-19
Here’s the situation. We still have classes despite the county shuttering for a few weeks. I mean they are online classes, don’t panic, we’re using zoom like a lot of schools. However, it means that we still have class work and what not going on. For our last assignment we had to come up with our own problem to solve, then solve it. It wasn’t as easy as it sounds, but that is how I got this request (see the title of the post). Don’t worry I’ll explain.
State-space modeling is the short name for the class (the full name is state-space modeling for physiological applications, a mouthful for sure). It sounds complicated and once you get into the details of the class, it is. However, the high level view of it is actually very simple.
State-space models are almost what they sound like. Ways to model a problem with different states of being. Think of a light switch, it has two states, on or off, we could model probabilistically if it is on or off using previous values or some other function like if we measured the ambient lighting. If we don’t physically look at the switch and we try to model it using some other feature (again ambient lighting, maybe time of day, time since the switch was on, etc) we call the light switch state our “hidden state.” The hidden state is what we are trying to get at.
I’ve had two make your own problem assignments for the class. The first problem I created was a Kalman filter estimation of a mouse cursor using a noisy position measurement. To be clear, we are estimating where the cursor would go next based on 1.) where it is when we last measured it (with some uncertainty because of noise) and 2. where it has already been (with some uncertainty as well). It was a fun assignment and below is the 3D representation of my solution vs the ground truth (the actual state). Since this was a problem I designed, I knew the ground truth, so it was easy to check my solution. Below is the plot I made for the assignment. The third dimension is time (no units, because it could be anything) and seeing it like this makes it easier to see the path it took (the other two dimensions are the X and Y, again unitless because this is all made up in a made up land with no real unit of measurement or time).
You’ll notice they are super close, this was because I had a good model, if I did not the accuracy would be off. In any case, you’re probably asking what this has to do with modeling the coronavirus. Well, for our second assignment we had to model a point process. A point process is a process that has two states only. Our lightswitch example is a point process, it has only two positions on, or off, a 1 or 0.
This is where I combined my love of epidemiology with our assignment and created (or recreated, the model was already formulated) a model for a novel strain of flu. At the time I wanted to model the COVID-19 outbreak, but the data was so inconsistent that I didn’t feel comfortable taking it on. Below is my model vs the ground truth for the data I had.
You’ll notice this time it wasn’t as accurate, but it is pretty close. Especially when you realize this model predicts a week ahead. That last week (week 21) doesn’t have a total tested bar behind it because it was my prediction for the week and I added in the actual value after the fact. Again, not a perfect prediction, but there are a few things to keep in mind. First, I used several simplifying assumptions that made it easier for me to create the model. Second, I was assuming no immunity and no vaccine, which for the flu was not exactly an assumption that was true. Lastly, there were some mixing coefficients that I had to estimate, which based on the output from the model, were slightly lower than the true value.
All this to say, my instructor was impressed. I was the only person to come up with an epidemiology application for what we are learning in the class. Now because COVID-19 is spreading and any semi accurate model is a good model, she has tasked myself (along with most of the rest of the class) with creating state-space models for different regions. Since it was my baby, I got to make first pick and went with modeling the outbreak here in the US. It’s a learning assignment so the stakes are low, but I am taking this very seriously, so I will be doing my best to create a model that best represents the spread of the virus and I’m hoping to include the effects of social distancing and what not into it as well.
In the end it will be a bit more complex than my “simple” flu model, but I’m excited to try to do my part. I mean at the end of the day, it’s just a class assignment and probably isn’t going to change the world, but it will be a good exercise and a reminder that what I am learning can be applied to more than just neuroscience. As usual, I’ll share the results of my work here with all of you, but the assignment isn’t due for about two weeks, so you won’t see the results until then.
In the meantime, do your part by keeping your distance, washing your hands, and not touching your face. Stay safe, be careful with what you touch in public, and if you feel sick please stay home. If you do that, you can and will save lives!