- Notifications
You must be signed in to change notification settings - Fork3
Code and real data for "Counterfactual Temporal Point Processes", NeurIPS 2022
License
Networks-Learning/counterfactual-tpp
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is a repository containing code and real data for the paperCounterfactual Temporal Point Processes, published at NeurIPS 2022.
This code depends on the following packages:
networkx
numpy
pandas
matplotlib
to generate map plots:
GeoPandas
geoplot
In order to install the project dependencies you can run the following command:
pip install -r requirements.txt
- src/counterfactual_tpp.py: Contains the code to sample rejected events using the superposition property and the algorithm to calculate the counterfactuals.
- src/gumbel.py: Contains the utility functions for the Gumbel-Max SCM.
- src/sampling_utils.py: Contains the code for the Lewis' thinning algorithm (
thinning_T
function) and some other sampling utilities. - src/hawkes/hawkes.py: Contains the code for sampling from the hawkes process using the superposition property of tpps. It also includes the algorithm for sampling a counterfactual sequence of events given a sequence of observed events for a Hawkes process.
- src/hawkes/hawkes_example.ipynb: Contains an example of running algorithm 3 (in the paper) for both cases where we have (1) both observed and un-observed events, and (2) the case that we have only the observed events.
- ebola/graph_generation.py: Contains code to build the Ebola network based on the network of connecteddistricts. This code is adopted from thedisease-control project.
- ebola/dynamics.py: Contains code for sampling counterfactual sequence of infections given a sequence of observed infections from the SIR porcess (the
calculate_counterfactual
function). The rest of the code is adopted from thedisease-control project, which simulates continuous-time SIR epidemics with exponentially distributedinter-event times.
The directoryebola/data/ebola contains the information about the Ebola network adjanceny matrix and the cleaned ebola outbreak data adopted from thedisease-control project.
The directoryebola/map/geojson contains the geographical information of the districts studied in the Ebola outbreak dataset. The geojson files are obtained fromNominatim.
The directoryebola/map/overall_data contains data for generating the geographical maps in the paper, and includs the overall number of infection under applying different interventions.
The directoriessrc/data_hawkes andsrc/data_inhomogeneous contain observational data used to generate Synthetic plots in the paper. You can use this data to re-generate paper's plots. Otherwise, you can simply generate new random samples by the code.
- Ebola Epidemic Simulation and Counterfactual Calculations
- Generate Geographical Distribution of infections
If you use parts of the code in this repository for your own research, please consider citing:
@inproceedings{noorbakhsh2022counterfactual, title={Counterfactual Temporal Point Processes}, author={Noorbakhsh, Kimia and Gomez-Rodriguez, Manuel}, booktitle={Advances in Neural Information Processing Systems}, year={2022}}
About
Code and real data for "Counterfactual Temporal Point Processes", NeurIPS 2022
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.