## Recently, a question popped into my head.

It seems like bitcoin might be directly related to the US market. So I decided to take up some newbie level data science to take a look at the data from both a statistical and personal analytical perspective.

## But how?

Well, I decided to write a short python program that takes the historical pricing data of both the VTSAX (Vanguard Total Market Index) and Bitcoin and then plot both of them so I can visually inspect to see if there is any obvious correlation. This was relatively simple, I whipped out my google-fu and hopped into pycharm and voila, I had a simple python program that gives me a very simplistic comparison, but it’s enough to understand the base concept of the possible correlation between the two.

While using percent change may not be the perfect method for determining relative correlation of two asset prices, I believe it will be adequate to satisfy my morbid curiosity on the matter. So I chose to grab a simple Pearson correlation between the two percent change values which is essentially a very basic form of linear regression.

## But what were the results?!

Well, first we’ll take a look at the graph. The graph below shows a plot of the percent change in price of BTC vs the percent change in the price of VTSAX. We can see that while Bitcoin has a higher variance there does seem to be some fairly limited correlation here. We especially see in the COVID era (Early 2020) there was some correlation in variance between the percent change of bitcoin and the percent change of the total market index, with bitcoin remaining significantly more volatile.

The Pearson correlation for these values came out to a value of 0.151 which is considered a low degree of correlation in terms of Pearson correlation. This shows that bitcoin and the total market, while slightly correlated do not show a significant or tradeable amount of correlation.

## Conclusion

Bitcoin and the total market index show a minimal level of correlation, but an interesting observation is that when the total market index shows high levels of unsureness and lack of confidence in the market it seems that this market sentiment also carries over to large variance in the price of bitcoin. This shows that, at some level, despite being a “decentralized” currency Bitcoin is still affected by the total market sentiment in the US markets.

```
import matplotlib.pyplot as plt
import pandas as pd
import scipy
if __name__ == '__main__':
BTC = pd.read_csv('data/BTC.csv')
VTSAX = pd.read_csv('data/VTSAX.csv')
BTC['Date'] = pd.to_datetime(BTC['Date'])
VTSAX['Date'] = pd.to_datetime(VTSAX['Date'])
newFrame = pd.merge(BTC,VTSAX, on='Date', how='right')
newFrame = newFrame[['Date','Close_x','Close_y']]
newFrame['BTC_percentchange'] = newFrame['Close_x'].pct_change()
newFrame['VTSAX_percentchange'] = newFrame['Close_y'].pct_change()
print(newFrame['BTC_percentchange'].corr(newFrame['VTSAX_percentchange']))
print(newFrame)
plt.plot(newFrame['Date'],newFrame['BTC_percentchange'],label = 'BTC Percent Change')
plt.plot(newFrame['Date'], newFrame['VTSAX_percentchange'], label = 'VTSAX Percent Change')
plt.legend(loc="upper left")
plt.show()
```