Estimating the Future Difference in Return for a Bitcoin difficulty period

using mean hash rate as a predictor variable

Jul 5 · 4 min read

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.


NB this is super simplified — for more detailed/correct explanation, see 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.


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.


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.


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.

Image for post
figure 1 — OLS model
Image for post
figure 2 — OLS model parameters estimation


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


Image for post
figure 3 — autocorrelation in the residuals is significant

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

Image for post
figure 4 — Prais model allowing for autocorrelation
Image for post
figure 5 — estimate of Prais model parameters and comparison to OLS.



Image for post
figure 6 — RVF plot. Potentially some mild heteroscedasticity. Probably OK to move on.


Image for post
figure 7 — Residuals appear very normal
Image for post
figure 8 — as per figure 7, residuals follow the normal curve well.
Image for post
figure 9 — the Shapiro test gives us no reason to reject the null (the null of the test is normality)


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

Image for post
figure 10 — performance of the Prais model compared to actual values.


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 (it is a private account, but I accept most follow requests, for now).

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store