Data Analysis on The Effect of Inflation on Primary Assets

Posted on Sep 10, 2021
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Background

What is inflation?

Inflation is the decline of purchasing power of a given currency over time. A quantitative data estimate of the rate at which the decline in purchasing power occurs can be reflected in the increase of an average price level of a basket of selected goods and services in an economy over some period of time. The rise in the general level of prices, often expressed as a percentage, means that a unit of currency effectively buys less than it did in prior periods.

Key Measures of Inflation

There are numerous ways to calculate inflation including:

  • CPI (Consumer Price Index)
  • US M2 (United States Money Supply)
  • PCE (Personal Consumption Expenditures)
  • Wage Inflation
  • RPI (Retail Price Index)

For this project, the focus was on CPI and US M2.

CPI was chosen as it is the most popular measure of inflation.

US M2 was chosen due to the extremely drastic changes seen in the US M2 due to the various stimulus checks and other government subsidized help to consumers and businesses in recent months.

CPI: Consumer Price Index

The Consumer Price Index (CPI) is a measure that examines the weighted average of prices of a basket of consumer goods and services, such as transportation, food, and medical care. It is calculated by taking price changes for each item in the predetermined basket of goods and averaging them. Changes in the CPI are used to assess price changes associated with the cost of living.

The CPI is one of the most frequently used statistics for identifying periods of inflation or deflation.

US M2: United States Money Supply

M2 is a calculation of the money supply that includes all elements of M1 as well as "near money." M1 includes cash and checking deposits, while near money refers to savings deposits, money market securities, mutual funds, and other time deposits. These assets are less liquid than M1 and not as suitable as exchange mediums, but they can be quickly converted into cash or checking deposits.

Hedging Inflation

As of June 2021, the nation saw both its largest monthly and year-over-year increase in inflation (CPI) in the last 13 years.

In 2020, the US printed 24% of the all the money in circulation prior to 2020 (US M2).

Due to these drastic changes in these inflation markers, it is important for investors to understand what assets have performed well during these times in the past, both recently and historically.

This project will focus in on three primary assets, Gold, Bitcoin, and the S&P 500, and how they have performed in times of drastic changes in CPI and M2.

Datasets & Methodology

Datasets Used:

Note: In an ideal world, more frequently sampled CPI and M2 data would have been used to create more data points, and provide a clearer picture on how Gold, BTC, and the S&P 500 change with inflation. Additionally, S&P 500 data prior to 2013 would have been used. However, due to data availability, and financial restraints, this was not possible.

Methodology

All datasets were cleaned and manipulated to allow for seamless aggregation of the datasets

Calculated % Change of US M2 and CPI

Categorized US M2 and CPI periodic changes into 'High', 'Normal', and 'Low' periods of change based on the mean and standard deviations of the datasets

Calculated % Change of Gold, BTC, and the S&P 500 over given US M2 and CPI timeframes

Created series for Gold, BTC, and the S&P 500 % changes based on categorical change variables for US M2 and CPI

Compared and hypothesis tested various series created for Gold, BTC, and the S&P 500 in order to understand:

  • How these assets perform during 'High', 'Normal', and 'Low' changes in US M2 and CPI
  • If there is statistical significance to changes in asset performance based on changes in US M2 and CPI (p-value < 0.10)

Note: The Mann-Whitney U Hypothesis Test was used for this analysis as it is better for smaller, non-normally distributed datasets.

CPI Exploration and Data Analysis

Data on The Historical Effect of Drastic Changes in CPI on Gold

Over the last 40 years, CPI has shown a consistent, linear rise (Figure 1A). Additionally, we see a very clean, normal distribution for CPI's monthly rate of change (Figure 1B).

Figure 1A: CPI Trend since 1980

Data Analysis on The Effect of Inflation on Primary Assets

Figure 1B: Histogram of Monthly CPI Change since 1980

 

Using CPI's monthly rate of change, its mean (0.249%), and its standard deviation (0.340%), ranges were created to categorize 'High', 'Normal', and 'Low' changes in CPI.

  • 'High' category consisted of any month showing a change of more than 2 standard deviations above the mean
  • 'Low' category consisted of any month showing a change of less than 2 standard deviations above the mean
  • 'Normal' category encompassed all remaining data points

Due to the small sample sizes for BTC and the S&P 500 at 'High' and 'Low' CPI changes, this portion of the project will focus solely on Gold.

Data on Gold's Rate of Change

For 'Normal' CPI changes, Gold's rate of change shows a fairly normal distribution. However, for both 'Low' and 'High' CPI changes, Gold's rate of change does not show a clean, normal distribution (Figure 2). The means for 'High', 'Normal', and 'Low' CPI changes were calculated to be -2.49%, 0.43%, and -0.28%, respectively (Figure 3).

Data Analysis on The Effect of Inflation on Primary Assets

Figure 2: Histograms of Monthly Gold Change by CPI Change Categories

Figure 3: Mean Gold Monthly Change by CPI Change Categories

 

Although there is a difference in means across all three series, only changes in Gold at 'High' and 'Normal' changes in CPI show a statistically significant difference (p-value = 0.09) (Figure 4).

Figure 4: P-Values for Gold Monthly Changes for CPI Change Categories

This data suggests that contrary to popular belief, Gold has not been a good hedge against CPI inflation over the last 40 years. When monthly CPI has shown a drastic increase (< 0.93%), Gold's value has shown to decrease by an average of 2.49% compared to its normal average increase of 0.43%.

In other words, during months of high inflation, Gold has decreased both in totality and versus its normal monthly change.

Data on The Current Effect of Significant Changes in CPI on Gold, BTC, and the S&P 500

Since 2013, CPI has shown a consistent, linear rise (Figure 5A). Additionally, we continue to see a fairly normal distribution for CPI's monthly rate of change (Figure 5B). However, the CPI trend is noisier and the rate of change distribution is not quite as clean as seen over the last 40 years.

Figure 5A: CPI Trend since 2013

Figure 5B: Histogram of Monthly CPI Change since 2013

 

The same methodology for the 40 year review was repeated in order to categorize 'High', 'Normal', and 'Low' changes in CPI. The only difference here was that one standard deviation above and below the mean were used for the 'High' and 'Low' CPI change categories. This allowed for more data points to be placed in the 'High' and 'Low' CPI change categories for all assets.

Once again, most of the change distributions by asset and CPI change category reflect a non-normal distribution (Figures 6A-C). For Gold, the means for 'High', 'Normal', and 'Low' CPI changes were calculated to be 0.30%, 0.23%, and -0.02%, respectively. For BTC, the means for 'High', 'Normal', and 'Low' CPI changes were calculated to be 14.11%, 13.36%, and 0.92%, respectively. Finally, for the S&P 500, the means for 'High', 'Normal', and 'Low' CPI changes were calculated to be 2.16%, 1.37%, and -1.22%, respectively (Figure 7).

Figure 6A: Histograms of Monthly Gold Change by CPI Change Categories

Figure 6B: Histograms of Monthly BTC Change by CPI Change Categories

Figure 6C: Histograms of Monthly SP500 Change by CPI Change Categories

Figure 7: Mean Asset Monthly Change by CPI Change Categories

Analysis

After hypothesis testing these datasets (Figure 8):

  • Gold - no statistical significance between datasets
  • BTC - statistical significance between 'Low' and 'Normal' datasets (p-value = 0.100)
  • S&P 500 - statistical significance between both 'Low' and 'Normal' (p-value = 0.041) and 'Normal' and 'High' datasets (p-value = 0.049)

Figure 8: P-Values for Asset Monthly Changes for CPI Change Categories

This data suggests that, since 2013:

When monthly CPI has shown a drastic increase (> 0.47%):

  • The S&P 500's value has shown to increase by an average of 2.16% compared to its normal average increase of 1.37%

When monthly CPI has shown a drastic decrease (< -0.15%):

  • The S&P 500's value has shown to decrease by an average of 1.22% compared to its normal average increase of 1.37%.
  • BTC's value has shown to increase by an average of 0.92% compared to its normal average increase of 13.36%.

In other words, during high months of inflation, the S&P 500 has performed very well, with a monthly change nearly double compared to normal months. During low months of inflation, the S&P 500 has not performed well, decreasing in totality and versus its normal monthly change, while BTC has still shown gains, but extremely modest when compared with its normal monthly change.

US M2 Exploration and Data Analysis

Data on The Effect of Significant Changes in US M2 on Gold, BTC, and the S&P 500

Since 2013, US M2 has shown a more parabolic rise (Figure 9A). Additionally, we see a fairly normal distribution for M2's weekly rate of change with a slight skew to the right (Figure 9B).

Figure 9A: M2 Trend since 1980

Figure 9B: Histogram of Weekly M2 Change since 1980

 

The same methodology for categorizing 'High', 'Normal', and 'Low' in CPI changes were used for the US M2. One standard deviation above and below the mean were used for the 'High' and 'Low' CPI change categories.

As with CPI, most of the change distributions by asset and M2 change category reflect a non-normal distribution (Figures 10A-C). For Gold, the means for 'High', 'Normal', and 'Low' CPI changes were calculated to be 0.22%, 0.09%, and -0.16%, respectively. For BTC, the means for 'High', 'Normal', and 'Low' CPI changes were calculated to be 3.13%, 1.71%, and 3.85%, respectively. Finally, for the S&P 500, the means for 'High', 'Normal', and 'Low' CPI changes were calculated to be 0.17%, 0.26%, and 0.12%, respectively (Figure 11).

Figure 10A: Histograms of Weekly Gold Change by M2 Change Categories

Figure 10B: Histograms of Weekly BTC Change by M2 Change Categories

Figure 10C: Histograms of Weekly SP500 Change by M2 Change Categories

Figure 11: Mean Asset Weekly Change by M2 Change Categories

 

Data Analysis

After hypothesis testing these datasets (Figure 12):

  • Gold - statistical significance between 'Low' and 'Normal' datasets (p-value = 0.095)
  • BTC - no statistical significance between datasets
  • S&P 500 - no statistical significance between datasets

Figure 12: P-Values for Asset Weekly Changes for M2 Change Categories

 

This data suggests that, since 2013 when weekly M2 has shown a drastic decrease (< -0.11%%) Gold's value has shown to decrease by an average of 0.16% compared to its normal average increase of 0.09%.

In other words, during months of low inflation, Gold has decreased both in totality and versus its normal monthly change.

Conclusions

  • Gold has performed poorly over the last 40 years at both 'High' changes in CPI and 'Low' changes in M2
  • The S&P 500 has performed well since 2013 at 'High' changes in CPI and poorly during 'Low' changes in CPI
  • BTC shows little statistically significant behavior due to changes in inflation markers besides showing minimal returns during 'Low' changes in CPI compared its normal monthly returns

Future Work to be Explored

  • Find datasets for CPI and M2 with more frequent sampling
  • Adjust 'High' and 'Low' parameters for CPI and M2
  • Apply analysis to ETH
  • Look at global markets and inflation
  • Use weakening dollar vs other currencies as a proxy for inflation
  • Categorize periods of high inflation to understand if the specific causes result in different responses in Gold/BTC/S&P 500 prices
  • Correct for the effects of social media on BTC

Additional Sources

 

Guide to Inflation

Consumer Price Index (CPI)

M2

About Author

Jonah Gerstel

Jonah graduated Tulane University in 2017 with a B.S. in Chemical Engineering. He then went on to work in the CPG and Food and Beverage Industries as a Process Engineer, gaining his Lean Six Sigma Green Belt. He...
View all posts by Jonah Gerstel >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories


Our Recent Popular Posts


View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI