Early Warning Programs

Hidden Markov Model

This HMM was implemented by slightly modifying the source code written by Meyers and Whitson (1995). Their C++ code implements a left-right hidden Markov model and the corresponding Baum-Welch maximum likelihood training algorithm using the algorithms described by Rabiner (1989). I translated this code from the Solaris C++ environment to a Macintosh CodeWarrior ANSI C environment, in the process combining Meyers and Whitson's separate driver programs for training and testing into a single program, and modifying the input format for sequences to handle the BCOW and WEIS sequences. The .zip version of the files is for the benefit of those using Windows or UNIX: the program code is in ASCII text files.

1997 Version

This is the code used for the estimates published in Philip A. Schrodt, "Early Warning of Conflict in Southern Lebanon using Hidden Markov Models." pp. 131-162 in Harvey Starr, ed. The Understanding and Management of Global Violence: New Approaches to Theory and Research on Protracted Conflict. New York: St. Martin's Press, 1999.

Hidden Markov model source code and data files (.sit)
Hidden Markov model source code and data files (.zip)

2000 Version

This is the code used for the estimates in Philip A. Schrodt, Forecasting Conflict in the Balkans using Hidden Markov Models (Paper presented at the American Political Science Association meetings, 31 August - 3 September, 2000). This version extends the Meyers and Whitson implementation to handle the left-right-left (LRL) model, and implemented the Viterbi algorithm described in Rabiner (1989) in order to estimate the most likely state sequence. In the process of extending the model to the LRL form, I rewrote the estimation equations to correspond exactly to those in Rabiner -- the Meyers & Whitson implementation differed slightly from Rabiner's equations, presumably because their models estimate a separate vector for "transition symbols."

In addition to these extensions of the estimation methods, this code is considerably more elaborate and contains options for a variety of different forecasting schemes, a genetic algorithm for finding optimal starting points for the estimation, and a parallel-computer implementation using the MPI protocol. The compressed files include a 16-page "User's Guide" in MS-Word format, a program for converting event data to the sequences used by the program, and formatted sample sequences for the Balkans and Liberia. The code has been run under both the CodeWarrior for the Macintosh (OS 8.5) and the cc compiler in the IRIX 6.5 OS (a Unix variant) on a SGI Origin 2000 parallel computer

Hidden Markov model source code and data files (.sit)
Hidden Markov model source code and data files (.zip)