written by

Denis Krivitski

CTO, Avoncourt Partners GmbH

Technology Blog - Apr 2, 2018

Using machine learning for predicting tomorrow’s national stability

Overview

Knowing a nation’s future political situation is useful for anyone trading stocks, currencies, or other securities. So, we have made an attempt to predict it using Machine Learning. We could predict the situation correctly in 70% of the cases.

Measuring national stability

The political situation of any country is thoroughly covered in the news. We used Natural Language Processing analysis of a large amount of news articles crawled from the web. Articles were automatically grouped by the specific events that they describe, and every event was assigned a numeric measure of its conflict or cooperation intensity. The conflict or cooperation intensity is measured according to the Goldstein¹ scale. The Goldstein scale starts with -10 meaning a military attack, and ends with +10 meaning an economic aid or military assistance.

We averaged the Goldstein values of all events happening in a country or between two countries on a daily basis to create a time series of stability measurements.

Prediction algorithm

We trained a Long Short-Term Memory (LSTM) Recurrent Neural Network (RNN) to classify next day Goldstein scale readings in two categories:

  • Stable – Goldstein values above world wide median of +1.06
  • Unstable – Goldstein values below world wide median of +1.06

We used a 30 day retrospective window as an input to the neural network and two dimensional softmax classifier as the output.

We trained the neural network on 1,000,000+ samples, and tested the resulting accuracy on about 100,000+ data samples.

Results

The algorithm achieved 70% accuracy. The figure below shows a sample sequence of aggregate Goldstein scales together with predictions. Green lines mean the prediction was stable and the height of the line is the prediction confidence. The red lines mean the prediction confidence for unstable predictions.

Conclusion

Of course 70% accuracy is not high enough to warrant investment decisions based solely on this factor, but it can serve as a useful indicator for a human trader.

 


Footnotes

1 Joshua S. Goldstein, “A Conflict-Cooperation Scale for WEIS Events Data”

 

About us

We are a team of AI specialists working at the technological unit of Avoncourt Partners GmbH. On a daily basis we conduct R&D activities in the AI area for our cus- tomers. We specialise in Natural Language Processing of textual information, mainly news, and predicting various financial and economic indicators.