Skip to content

A Gibbs sampler for estimating epidemiological parameters from influenza-like illness time series

License

Notifications You must be signed in to change notification settings

chvandorp/flu-sampler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flu-sampler project

This program can be used for estimating epidemiological parameters. This is achieved with Gibbs sampling.

compiling the code

Simply cd to the flu-sampler folder, and run make:

$ cd flu-sampler/
$ make

running the program

From the flu-sampler folder, run

$ ./flu-sampler [-s <seed>] [-v <vid>] [-m <mode>] [-l <length>] [-t <thinning>] [-i <imitations>]

where is a seed (non-negative integer) for the random number generator; is an identifier for the output files; can be mcmc for MCMC, wbic for WBIC, help for help; is the length of the chain (pre-thinning) is the number of states skipped between stored states is the number of simulated timeseries

TODO: new features added

data files

The following files need to be present in the data/essential folder: Data needed for MCMC:

  • m-matrix-small.txt -- contact matrix for the 6 age classes
  • sortedIliData.txt -- simplified and combined the ILI data
  • seasons-daynumbers.txt -- seasons defined by an interval of day numbers (from 01/01/1970 onwards)

If all goes well, the following files will be created in the data/ folder after running the program:

  • full-ili-chain-.xml -- the thinned chain (posterior)
  • sili-.xml -- simulated data, parameters sampled from the posterior

where is an identifier given by the uses (defaults to "test"

TODO: new IO files added

Jupyter notebooks

Jupyter notebooks with the extension .ipython.cln are included in the repository. These are clean versions of the notebooks (i.e. without output). In order to make the actual notebooks, run from the folder flu-sampler-project/flu-sampler/

make -f nbs.makefile

The following notebook can be used for analysing the chain, plotting data, producing easy-to-parse data files:

  • ili-data-and-fit-age-stratified.ipynb -- load the chain, and analyse
  • plot-simulated-data-age-stratified.ipynb -- load simulated data (sampled from posterior) and plot
  • sort-raw-ili-data.ipynb -- make data files (requires original ILI data)
  • TODO

Before you want to commit modified notebooks to the repository, run

make -f cln.makefile

This will write cleared copies of the notebooks x.ipynb to the files x.ipynb.cln

About

A Gibbs sampler for estimating epidemiological parameters from influenza-like illness time series

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published