Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.
/ ma-thesis Public archive

Executive Constraints and Civil Conflict

License

Notifications You must be signed in to change notification settings

jsks/ma-thesis

Repository files navigation

Master's Thesis

Code repository hosting replication files for the analysis of executive constraints and civil conflict onset.

Dependencies

The following raw data sources are required. For copyright reasons they are not distributed in this repository and need to be downloaded manually and placed in the following locations:

The full replication pipeline is designed to be run from a docker container. A pre-built image as used in the latest version of the manuscript is available at dockerhub and will be downloaded automatically when running the pipeline.

Alternatively, the image can be built from scratch using the following script:

# Creates an image tagged as jsks/conflict_onset:latest
$ scripts/build.sh

Running the pipeline

To run all included models and create the manuscript pdf, the following script can be used:

# Launches an attached instance of `jsks/conflict_onset` with `./`
# mounted at /proj. Default output will be `./paper.pdf`.
$ scripts/run.sh

The run.sh script assumes 4 available CPU cores, meaning that each Stan model will be invoked with a corresponding number of chains.

Note, on a Google Cloud c2-standard-4 (4 vCPUs, 16GB memory) this takes approximately 3 hours to run.

Any arguments to run.sh will be passed to make, the taskrunner for the underlying pipeline (example: dry-run with make, scripts/run.sh -n). For replication purposes make should not be accessed directly outside of docker; however, there are several convenience rules defined for development workflows that can be listed with make help.

Individual models, listed as json profiles in ./models/, can also be run separately. For example:

$ scripts/run.sh full_model

Finally, for any model run the full posteriors will be saved under ./posteriors/<model_name>. Since the final posterior object is far too large for most workstations, the following extracts are available which can easily be read into R:

  • reg_posteriors.csv: regression parameters (intercepts and betas)
  • fa_posteriors.csv: measurement model parameters (lambda, gamma, psi, etc, etc)
  • err_posteriors.csv: example estimated latent values from error model
  • extra_posteriors.csv: predicted probabilities from regression and log likelihood

License

This project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.