项目作者: jsks

项目描述 :
Executive Constraints and Civil Conflict
高级语言: R
项目地址: git://github.com/jsks/ma-thesis.git
创建时间: 2019-07-22T12:27:16Z
项目社区:https://github.com/jsks/ma-thesis

开源协议:Creative Commons Attribution Share Alike 4.0 International

下载


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:

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

Running the pipeline

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

  1. # Launches an attached instance of `jsks/conflict_onset` with `./`
  2. # mounted at /proj. Default output will be `./paper.pdf`.
  3. $ 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:

  1. $ 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.