flusim

Github Link Report Document Python package on TestPyPI

2023/09-2023/12 Python Simulation Markov Processes LaTeX

Basic Info

This was a project that I worked on in the class Simulation (ISYE-6644) at Georgia Tech’s OMSA program.

The Idea

The project idea was one of those given in a proposed project topics in this course. Roughly speaking, the original topic has the following settings and the corresponding questions posed:

Settings

Consider a population of size 31, and a flu going on in this population. The flu has some properties:

  • Day 0, the number of sick students if 1
  • An infected person has a probability p=0.02 infecting any healthy person
  • An infected person will remain infected for precisely 3 days
  • This flu doesn’t kill people

Problem

  1. Calculate the distribution and expected number of number of people infected at day 1, 2
  2. Simulate and find an approximation of the distribution of end-date of flu

My idea was then to write a Python class (and eventually it became a Python package, though no people use it) that has the following functions:

  1. Supports calculations of exact statistics
  2. Supports simulations for approximation of statistics
  3. Supports basic visualizations of the fluspread process

My Works

I first formulated a more general version of this problem (where population size, infecting probabilities can be tweaked) mathematically, and designed pseudocodes for exact solvers, simulations for statistics (such as {distributions / expectations / variance} of {number of infected people / end dates}).

The related theory I used for designing the exact solver was that of Markov chain1, where some of the statistics can be done via such general methods - for example, expectations, variance of end dates are analyzed via first step analysis techniques.

Some Screenshots

Final Thoughts

It was pretty cool seeing the things I derived with the theory of Markov chains matching the simulation results, a type of “mathematical joy” I would say.


  1. This was a fun problem to work with from a mathematical viewpoint, but it was later that I learned that such model is a type of SI model (without the “R”). ↩︎