Data Analysis on The Effect of Inflation on Primary Assets
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:
- Monthly CPI since 1980
- Weekly M2 since 2013
- Daily Gold Prices since 1980
- Daily BTC Prices since 2013
- Daily S&P 500 Prices since 2013
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).
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).
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).
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.
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).
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)
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).
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).
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
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