Predicting Economical Bank Crises of African Nations

Adrian -
7 min readJun 6, 2021

By: Adrian Arisgraha and Justino Hermanto

Background:

The economy is one of the biggest factors in determining how well off the people of a country live and how much social prosperity is shared with the rest of the country instead of just the 1%. This is all dependent on how well the government manages its resources, manpower, and international dealings.

A simple way of determining how prosperous a nation’s economy is would be its GDP, or ‘Gross Domestic Product’. According to the International Monetary Fund, the continent with the most amount of GDP per Capita is Oceania, followed closely by North America, Europe, Asia, South America, and in dead last, Africa, which has been struggling with its economy due to numerous bank crises happening in various nations within the continent.

A Bank Crisis is defined by Lumenlearning as a state where there are widespread Bank Runs: where an abnormal number of depositors try to withdraw their deposits because they don’t trust that the bank will have the deposits for withdrawal in the future.

The most famous example of a Bank Crisis is the South Sea Bubble, which was an incident where the South Sea Bank, after a crisis prompting massive amounts of withdrawals from various clients could not fulfill every withdrawal demand and eventually shut down due to bankruptcy. A bank crisis, much like the stock market is a snowball rolling downhill, once it starts, it will cause more and more people to try and replace the money they own and ergo, less stability.

A bank crisis is mostly caused by a lack of trust that their banknotes will rise in value in the future, which is pretty sound logic. It is indeed like investments, if your currency does nothing but decreases with time, why keep it? The smart move is to swap it with a currency that is stable or even rising with time.

Main Conflict:

The Main Conflict we’re trying to tackle in this article is how to predict a Banking Crisis. With how dangerous a banking crisis is for a nation’s prosperity, we would like to find a way to predict if a banking crisis is happening the minute we get data on important factors like the national GDP or its foreign exchange rate.

Data Preprocessing:

The first thing we did with the Data is to narrow down the scope. To do this, we’ve evaluated the Data and we’ve chosen the most interesting nation to talk about, with their own shares of Bank Crises. We then try and set up a time limit as to not process too much data for this article. We eventually found the perfect nation to discuss.

From the data, we’ve narrowed it down to Egypt as the main base of our article. We chose this nation over the others because its economy per capita is somewhere in the middle, not too high like Rwanda and not too low like Zimbabwe. The most interesting part about Egypt is how it had 6 bank crises in a row in the 1990’s, which we will use as a time period for our data.

To summarize, the data we will be using is a modified version of a Dataset of Economical Data from various Nations in Africa. In this dataset, we’ve limited our scope to only discuss the most middling nation, which is Egypt during its darkest economical period, which is from the 1990s, from the year 1990 and ending in the year 2000.

EDA:

We uses the Command ‘isna’ on the data above to show which data is currently empty, If there are data, then the table will return a ‘False’ to show that there is data inside of the table.

Code from ‘Isna.any’ functions the same as ‘isna’ that checks data for whether it has a content inside of it or not. The only difference is that it will show titles for every data and isn’t as detailed as the ‘Isna’ coding.

Coding menggunakan kata drop yang berfungsi menghapus judul dalam data sementara tanda dari[‘] berguna untuk select all dari semua judul data yang di targetkan

Coding uses the word ‘drop’ that function is to erase the data within while the apostrophe symbol (‘) is used as a shortened version of a select all to show what is getting targetted by the drop.

Data1 has been confirmed as a data from the column, and the banking_crisis data has been changed from yes to 1, and no to 0

A table from Data1 with 5 data, using the coding head to show the first 5 data within the dataset.

Visualisation from exch_usd visualized with a graphic bar that shows the increase per year.

Visualisation from Inflation_annual_cp1 from data1 where we can see the barplot going down.

Data Analysis:

The coding above functions as a way to drop column Case and CC3. Axis = 1 functions as a column marker while inplace=true is made to allow copy of a data but if it’s true, then it’s left alone.

The second, coding banking_crisis to 0 and 1 to replace no and yes respectively.

In currency_crisis, the data with 2 on the label was dropped to 0 so there’s only 0 and 1.

The coding above is a visualization from a heatmap from an entire column. Correlation used in the heatmap is a spearman because the data in the column is comprised of all 0s and 1s.

Data from Systemic Crisis are mostly 0 so there are a lot dropped.

In the Heatmap, the reddest part on banking crisis correlates with the Systemic Crisis. Debt and Inflation gets second place, but not as strong as Systemic Crisis.

Coding above discusses data that’s compiled into code df2 but country and systemic crisis was dropped because data only recognizes integers, not variables. The visualisation above shows the creation of X2 as a coding of df2’s Banking_crisis replacing crisis and No_crisis with 1 and 0 respectively

From the coding above, we made sure that in banking_crisis, 1 means crisis while 0 means no crisis. In upsample minority, we made umsampled crisis that functions as a way to show crisis_upsample from the column, meanwhile combine majority and upsample minority fuses or creates concat (Fusing 2 or more tables) from no_crisis and crisis_upsampled in making upsampled.bannking_crisis.value_counts(), we need data that is

y= upsampled.banking_crisis as a dependent

X = upsampled.drop(‘banking_crisis’, axis=1) as the independent

And using x_train , x_test , y_train , y_text = train_test_split to count split data from X,y text_size = 0,2 and random_state = 42

Coding above is to show which accuracy level is the most appropriate for the column that’s been discussed with classifiers:

LogisticRegression’ : LogisticRegression(solver=’liblinear’),

‘KNeighborsClassifier’: KNeighborsClassifier(),

‘NaiveBayes’ : GaussianNB()

In the model report from the original dataframe, our table uses column Title model and Accuracy for classifier in zip within of which, classifiers.values, classifiers.keys and to fill in like the provided image above the model is classifier_name, accuracy, is the accuracy_score(y_test, y_pred)}

Acknowledgement

The dataset we’ve used in our project today was provided by Kaggle.com, specifically the user ‘Chiri’ with his dataset, Africa Economic, Banking and Systemic Crisis Data which has Data on Economic and Financial crises in 13 African Countries (1860 to 2014). This Data is instrumental for our project and it wouldn’t have been able to be made without it.

For Sources, Analyzing Indicators from African Countries, again from Kaggle.com helps a lot with figuring out the coding side, while from the theory side, we mainly took from Investopedia.net, ranging from definition of GDP to the explanation about inflation. Special mention should also be told to Historic-UK.com for help explaining the circumstances that led to the South Sea Banking Crisis.

--

--