# Estimating the Future Difference in Return for a Bitcoin difficulty period

## using mean hash rate as a predictor variable

**WARNING: This is not financial advice. Trading can get you REKT very quickly. Only do it if you know what you are doing and have fully comprehended all of the tax and legal obligations and sought the advice of a licensed financial advisor.**

## Background

**NB this is super simplified — for more detailed/correct explanation, see ****www.bitcoin.org****. **At the heart of Bitcoin is a data-structure called a “block”. A block holds a list of transactions. Blocks are generated by a process called “mining”. Mining is the process of trying to guess some of the parameters that instantiated the last block (such as parts of a timestamp). The guess has to be hashed to match the block parameters. The faster a miner can hash (aka hash rate), the more guesses they can make, and thus the more likely they are to find the next block, at which point the miner is rewarded with some Bitcoin. Mining hardware improves over time so that the hash rate increases regularly.

There is a feedback loop in Bitcoin that ensures that regardless of how much better mining hardware gets, each block will take on average around 10 minutes to be found: the difficulty in finding blocks is automatically adjusted by the software every 2016 blocks to ensure that the mean block inter-arrival time stays at roughly around 10 mins.

## Objective

Thus here I propose a simple model of value feedback wherein hash rate and price are intrinsically linked within the construct of each difficulty period. Further to this, I produce a model that can be used to predict future values of price given a hash rate and price history for a given difficulty period.

## Stationarity

We know from previous articles that the Bitcoin price series is non-stationary. Hash rate is similarly non-stationary. Also, because we are dealing with such a broad range in both hash rate and price, we will focus on the natural logs of both series. Since both log transformed variables are non-stationary, we will look at the distribution of first differences for both.

## Model

Preparation — first we take the mean price and hash rate for each set of 2016 blocks (aka difficulty periods). The time step used here is the difficulty period.

**OLS linear regression**

We begin by fitting the simple linear model in figure 1.

*Diagnostics*

The model seems to fit well, but first lets check for a common problem in time series —

*Autocorrelation*

The results of the Breusch test indicate significant autocorrelation in the residuals. This means we can’t really use the OLS estimates reliably — they are not going to be the BLUE (Best Linear Unbiased Estimator).

**Prais-Winsten regression**

Prais regression is used to control for autocorrelation. It assumes the residuals follow an AR1 process and accounts for it in the rho variable.

We will now fit the model in figure 4

*Diagnostics*

*Heteroscedasticity*

*Normality*

**Performance**

As expected for a model with an R² of 0.98, the performance of the Prais model is relatively good.

## Discussion

Here we have shown that there exists a useful relationship between hash rate and price (and given the incentives, it is expected as such). We have also provided quantitative estimates for the parameters of the model of the relationship and accounted for autocorrelation in the residuals. Using this model, one is able to estimate the mean price for a difficulty period given the periods hash rate and price history.

If you found this article interesting, please hold down the clap icon.

Thank you.

You can find me on twitter https://twitter.com/btconometrics (it is a private account, but I accept most follow requests, for now).