Predicting Adverse Regime Transitions (PART)
README last compiled on: 2019-12-17
Data and code for the V-Dem VForecast/PART project to predict the risk of adverse regime transitions.
Note from Andy (mosty for future Andy and Rick): The original work in
late 2018 and early 2019 leading up to the May 2019 Policy Day was all
done on Dropbox in the
regime-forecast folder. I copied some of the
contents of that folder here, and also bumped up one level a smaller
partial copy of
regime-forecast that was in this repo from before.
Data_management folder contains all of the
R scripts necessary
for data organization. Due to the size of the data files, we cannot
share them through this repo. However, you can find the finished
ALL_data_final_USE_v9.csv, in the
Models/input folder. For
this project we use V-Dem V9 along with a number of external data
Data_management/compile_external_data.R). Please contact
Andy for access to these data.
Models folder contains the scripts to estimate models. To run the
models, see the
train-model....R R scripts in the
scripts folder. It
should be possible to run all of the independently as long as the
neccessary packages listed at the top of each file are installed. The
working directory should be the
Models folder under this repo/project,
basename(getwd()) should be
Each model runner script depends on the input data in the
folder, and on the
0-setup-training-environment.R script to setup data
and other joint parameters shared by all the models.
output folder contains copies of the output from when we ran the
full set of models the last time before the May 2019 V-Dem Policy Day.
Cross-validation is used to tune and assess models. We did not set seeds
when running this, so some variation in output might be expected from
randomness in the CV data partitions.
AB 2019-11-25: I made minimal changes to be able to run
train-model1.R from the GH repo. I only checked that script as the
other models can take a while to run. I noticed that the output changes
slightly, not sure why.
ForecastApp folder contains the code for the Shiny dashboard on
the V-Dem website here