Skip to content

We present an algorithm for constructing stochastic matrices with ordered latent states to circumvent label switching and improve interpretability when modeling international relations with dynamical systems and topic models.

niklasstoehr/ordered-matrix-dirichlet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code for the Ordered Matrix Dirichlet

Niklas Stoehr (ETH Zurich), Benjamin Radford (UNC Charlotte), Ryan Cotterell (ETH Zurich), Aaron Schein (University of Chicago)

paper pre-print at https://arxiv.org/pdf/2212.04130.pdf

The code can either be run locally or tinkered with using our colaboratory notebooks. For quick exploration, we recommend the latter. In particular, we provide notebooks showing the following functionality:

Ordered Matrix Dirichlet (OMD) Basics

Comparison SMD, BMD and OMD
OMD Alpha Prior Comparison

The OMD within Popular Models

Latent Dirichlet Allocation LDA
Hidden Markov Model HMM
Poisson-Gamma Dynamical System PGDS
Dynamic Possion Tucker Model DPTM
Recovering Latent Patterns with an HMM and the OMD

Modeling International Relations using the OMD and the Dynamic Possion Tucker Model DPTM

Latent Parameters of DPTM fitted to ICEWS

Folder structure and installation

When running the code locally, you have to install the user-defined modules omd0configs,omd1data,omd2model. From the root, install the modules by executing

pip install -e omd0configs
pip install -e omd1data
pip install -e omd2model

omd0configs features configuration methods and other helper functions
omd1data features different data loading functionality
omd2model features different models

In addition, we recommend installing the requirements listed in the requirements.txt file:

pip install -r requirements.txt

Data

This repository offers functionalites for two kinds of data: synthetic data and real-world conflict data. For the latter, you need to download the freely accessible ICEWS coded event data from the Harvard Dataverse. In particular, we recommend downloading the event data from 2015 to 2020:

events.2020.20220623.tab.zip
events.2019.20200427085336.tab
events.2018.20200427084805.tab
events.2017.20201119.zip
events.2016.20180710092843.tab
events.2015.20180710092545.tab

Place the data at data/conflict/icews.

About

We present an algorithm for constructing stochastic matrices with ordered latent states to circumvent label switching and improve interpretability when modeling international relations with dynamical systems and topic models.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages