__STYLES__

Economic Variable Correlation and Productivity Model of Nigeria Using Python

Economic Variable Correlation and Productivity Model of Nigeria Using Python

About this project

Stage Five Task: Economic Variable Correlation and Productivity Model of Nigeria

Introduction

This report investigates the potential for identifying the economic values affecting the inflation rate and productivity in Nigeria through a financial analysis that examines the correlation between key economic variables. The analysis focuses on four key data points for the country:

  • M1 Money Supply: This metric represents the amount of readily available cash in circulation, potentially impacting liquidity and investment opportunities.
  • Real Exchange Rate (Black Market): The black market exchange rate can provide insights into the true value of a currency.
  • Country Stock Market Performance: Analyzing overall stock market trends can reveal broader economic health and potential buying opportunities.
  • Inflation Rate: Inflation impacts purchasing power and profitability.

By collecting data for these variables over a sufficient time period, the analysis aims to identify potential correlations between economic conditions and stock market performance.

Methodology

  •      **Data Collection and modification**
    

Data was collected from the official sites and merged together. The data set was then analyzed by Python and changing data type.

Conversion of necessary columns to numeric types.![](file:///C:/Users/Basma/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg)

  •      **Correlation Study**
    

Find the correlation between the different variables

The correlation between the different variables was found to be :

-Draw heatmap to get better understanding

The heatmap analysis reveals intriguing correlations between the economic variables examined in this report. As expected, inflation exhibits the strongest positive correlation with the real exchange rate (black market). This suggests that rising inflation weakens the domestic currency, potentially leading to a depreciation in the official exchange rate or a widening gap between the official and black market rates. This dynamic can impact companies that rely on imports or exports, potentially affecting their profitability.

Following inflation, the M1 money supply demonstrates a moderate positive correlation with the real exchange rate. An increase in money supply could theoretically strengthen the domestic currency, leading to an appreciation in the exchange rate. However, this relationship can be complex, and other factors like inflation or government policies can play a significant role.

The observed correlations suggest a potential domino effect. Rising inflation weakens the currency, which, combined with an increase in money supply, could further impact the exchange rate. The heatmap also reveals a positive correlation, between the real exchange rate and the country stock market performance. A stronger domestic currency (appreciation) might create a more favorable environment for investment, potentially leading to a rise in stock prices. Conversely, a depreciation of the currency could negatively impact investor sentiment and stock market performance. However, it's crucial to acknowledge that correlation doesn't imply causation. While these relationships provide valuable insights, further analysis is necessary to understand the underlying mechanisms at play.

To see the change of the variables with time

a) The money supply was plotted over time and as shown in the following figure it tremendously increased by time reaching about 31 million in 2024.

b) The Exchange rate was plotted over time and as shown in the following figure it increased stepwise from about 110 Naira to each dollar every time interval reaching a peak in 2023 to be about 1600 Naira to each dollar.

c) The Inflation was plotted over time and as shown in the following figure it showed unstable pattern up and down but tending to increase over time.

d) The stock market performance was plotted over time and as shown in the following figure it showed unstable pattern up and down but tending to increase in the past few years.![](file:///C:/Users/Basma/AppData/Local/Temp/msohtmlclip1/01/clip_image022.jpg)

  •      **Theoretical Framework:**
    

Increased Money Supply Effects:

· Currency Depreciation: More money in circulation typically leads to currency depreciation as the value of each unit of currency decreases.

· Stock Market Appreciation: Increased money supply can lead to higher stock prices as companies benefit from increased liquidity.

· Increased Inflation: With more money available, demand for goods and services may rise, leading to inflation.

  •      **Productivity Calculations**
    

First we have to calculate currency depreciation which involves comparing the value of a currency at two different points in time. The formula for calculating currency depreciation can be expressed as:

Currency Depreciation=(Previous Exchange Rate−Current Exchange /Previous Exchange Rate)×100%

Then using the following formula to calculate productivity

Productivity = (Stock Market Appreciation + Inflation) / Currency Depreciation

· This simplistic model assumes that a higher stock market and inflation indicate economic activity and that a weaker currency may affect productivity negatively.

  •      **Productivity Trend Analysis:**
    

By ploting the productivity with time, the trend shown was stable until 2023 vthen a tremendoud increase in 2024 which is correlated with the change in the exchange rate.

  •      **Productivity Baseline:**
    

Formula for Productivity Baseline:

· Productivity Baseline = (Initial Stock Market Value + Initial Inflation Rate) / Initial Currency Exchange Rate

· The baseline formula serves as a reference point to compare how changes in the variables affect productivity.

· In the context of the provided formula for the Productivity Baseline, the relation between these variables is evident. The formula suggests that the initial values of stock market performance and inflation, when combined and adjusted by the initial currency exchange rate, form the productivity baseline. This implies that changes in inflation rates can affect purchasing power and production costs, influencing overall economic activity. Similarly, fluctuations in the stock market can impact investor sentiment and capital flows, affecting businesses' investment decisions and economic growth. Changes in currency exchange rates can impact trade competitiveness, export-import dynamics, and overall economic performance. Therefore, understanding and monitoring the dynamics of inflation, stock market performance, and exchange rates are crucial for assessing and predicting productivity trends within an economy.

  •      **Productivity model calculations**
    

To develop a productivity model that analyzes the impact of M1 money supply, exchange rate, and stock market performance on productivity. Two models have been applied

The first model is linear regression![](file:///C:/Users/Basma/AppData/Local/Temp/msohtmlclip1/01/clip_image026.jpg)

It was found that the mean square error is very high which indicates that it is not the proper model so I used RandomForestRegressor model

By using the random Forest regressor it was found that it has high prediction and can be used as a model for further predicition of productivity. The Mean Squared Error of 0.0142 indicates that the Random Forest model has significantly reduced the error compared to the linear regression model. A lower MSE suggests that the Random Forest model's predictions are closer to the actual values, indicating a better fit.

  1. Feature Importances:
    • The feature importances show how much each feature contributes to the predictions made by the Random Forest model.
      • ‘Currency Depreciation’: 43.20%
      • 'Stock market': 50.86%
      • ‘Inflation’: 5.9%

The results indicate that Currency Depreciation is the most important feature, followed by Stock market performance and Inflation in that order

  •      **Currency Devaluation according to USD**
    

To calculate real currency devaluation using a reference currency with flat M1 growth and stable productivity, you can utilize the concept of the Real Exchange Rate relative to dollar so I plot a graph between Currency Depreciation and time. It showed stepwise slow decrease followed by tremendous sudden decrease in 2023 and 2024.

![](file:///C:/Users/Basma/AppData/Local/Temp/msohtmlclip1/01/clip_image030.jpg)Conclusion

The analysis used a Random Forest regressor model showcased strong predictive abilities, indicating its potential as a reliable tool for forecasting productivity trends. With a low Mean Squared Error of 0.0142, surpassing the accuracy of linear regression, the model demonstrated a close fit between predicted and actual values. Feature importance analysis highlighted Currency Depreciation as the most influential factor, followed by Stock Market Performance and Inflation, offering valuable insights into the drivers of productivity variations. Additionally, the examination of currency devaluation against the USD unveiled intriguing trends through Real Exchange Rate analysis, revealing a gradual decline followed by a significant drop in 2023 and 2024. These findings underscore the model's efficacy in predicting productivity shifts and provide a nuanced understanding of currency dynamics, essential for informed decision-making and future forecasting endeavors.

Discussion and feedback(0 comments)
2000 characters remaining
Cookie SettingsWe use cookies to enhance your experience, analyze site traffic and deliver personalized content. Read our Privacy Policy.