COVID-19 Model Code

To better prepare Minnesota for the impact of COVID-19 on the state, the University of Minnesota School of Public Health and Minnesota Department of Health (MDH) joined forces in mid-March, 2020, to build a mathematical model predicting the progression of the disease and its impact on Minnesota.

To run the model’s equations, create its graphic elements, and produce various scenarios, the team wrote specific code using the R language and software.

Questions or comments about the code?

Contact the project group:

Access the Code

COVID-19 model R code (access through github repository)

More on the Minnesota Model

To the classic equation for modeling infectious diseases called SEIR (Susceptible, Exposed, Infectious, Recovered), the first two versions of the Minnesota model added three extra stages representing people who are: Hospitalized, in ICU, or Dead. Its third version, released on May 8, 2020 [add link], incorporates emerging U.S. and Minnesota data about the pandemic and adds a new element to the equation: AI for Asymptomatic Infection.

The structure of the Minnesota COVID-19 model showing the elements in the equation and their possible paths.


Using the R code, the model can run different scenarios showing how people may move in and out of some of the stages over time and it can produce graphs, charts, and tables to make the information visible and accessible. This flexibility allows public health officials to try out different social distancing measures to predict how those actions affect the timing and number of COVID-19 cases and deaths in the state, and how soon our health care systems would be overloaded.

Originally, the team used estimates from China and Europe to craft some parameters for the Minnesota model because U.S. data was still limited. But the model is becoming ever more state specific as U.S. data grows and Minnesota-centric information becomes more robust. The team plans to produce new model versions every _______ weeks.

For more about the model, technical information on how it’s constructed, and related source material, go the MDH website. An FAQ provides quick answers.

Learn More

© 2015 Regents of the University of Minnesota. All rights reserved. The University of Minnesota is an equal opportunity educator and employer. Privacy Statement