Pages

Thursday, 6 February 2014

9.17 Estimating future bitcoin mining income

 Thursday, 6th February 2014

Previous posts in series

0. Introduction
Websites such as mining.thegenesisblock.com provide some very handy tools to estimate future mining income, and I use them if I need to do some quick calculations away from home. But if you use these tools without knowing how or what they calculate, you can end up misinterpreting results, using unlikely forecast values, or seeing correlations where there are none.

If you look back at some of the previous "ASIC choices" posts, you'll notice that while I gave details on how to accurately estimate mining earnings, I never provided a nice simple method for anyone to make a forward projection.

In this post I'll do that - show you a simplified way to estimate bitcoin mining income, step-by-step, and using at most a spreadsheet (groan) - no fancy R code necessary.

At the end of this post you will:
  1. Know a simple method for estimating future changes in difficulty, and be able to calculate confidence intervals for your forecast.
  2. Understand the relationship between the time taken for a retarget to occur and the change in difficulty.
  3. Be able to do your own difficulty change calculation.
  4. Calculate your expected income per Ghps (ignoring electricity costs).
Well, if I explain it well enough, you'll be able to do the above. If not, feel free to lambast my poor pedagogical skills.


1. Estimating a range of future changes in difficulty
Estimating how much the network mining difficulty will change even in the short term is very hard with any degree of accuracy. My recommendation is to either:
  • Estimate a range of future changes based on past changes.
If you want something that is more likely to be accurate, choose method 1 and do lots of reading, and try to estimate what the difficulty changes might be based on hashes added and dates. It's tricky and complicated.

Forecasting future data from historical data can also be tricky and complicated. I've previously posted forecasts using ARIMA and exponential smoothing, and I don't think those methods are easily spreadsheetable. I was able to do a regression forecast model (with confidence intervals) using a google docs spreadsheet, but it was neither simple nor easy.

Instead I decided on a so-called naive method of forecasting. The concept is simple - the next forecast data will be equal to the last one. In this case, the quantity of interest is the change in difficulty rather than the network difficulty itself.

When difficulty is increasing or decreasing at a constant rate, this method has been more reliable than I've expected. When difficulty is increasing or decreasing at an accelerating or decelerating rate (such as now), the naive method will tend to undershoot or overshoot the mark - something to keep in mind when you're planning with your forecast.


How to forecast difficulty using the naive forecast method:

Step 1: Decide how many retargets ahead you want to forecast. We'll call that number 'n'.

Step 2: Get historical difficulty data (use the spreadsheet below if you like - it's up to date as of today). I only use post-July 2011 data for my difficulty forecasts. Before this there were fewer miners and so a greater variance in the network hashrate and in difficulty, especially as MTGOX came online and as the GPU revolution hit. At the moment there are many miners and while the network hashrate is increasing exponentially, it is not doing so in a discontinuous fashion. Prior to July 2011 there were several abrupt changes in difficulty that simply cannot happen now.

Step 3: Starting from the most recent retarget, calculate the ratio between the first difficulty and the last difficulty for the last n retargets. For example, if you want to forecast six retargets ahead:

2,621,404,453 / 908,350,862 = 2.88589

This means that we are forecasting a 2.9 times increase in difficulty over the next six difficulty changes.

Step 4: Convert the six week forecast to a per retarget figure by taking the nth root of the estimate:


 2.88589 ^ (1/6) = 1.1932 (forecast that network difficulty increases by a factor of 1.1932 each retarget).

That's easy enough, so far, and if you like you can skip the next step and go to the next section. However, if you want to learn how to calculate forecast intervals, just stick with it for another step.

Step 5: Calculate forecast intervals. To do this, you'll need to repeat steps 3 and 4 for your historical difficulty data. This is column C in the spreadsheet below. Next, copy the values from column C to column D, increasing the row number by n - if you're forecasting six retargets ahead, as in the spreadsheet, C8 is copied to D2, C14 to D8, and so on. The log of column D / column C are the "residuals" of your forecast.

Residuals are required to calculate forecast intervals (residuals are also required to be normally distributed - you'll have to take my word for it that they are). A forecast interval is a range of values that a forecast could be - it's only the mean value that we're forecasting. A 95% confidence interval would mean that, were the forecast to be run concurrently in one hundred different universes, 95% of the time the actual data would be within the forecast interval.

However, as miners. we're not really interested in lower an upper bounds - we just want worst case scenarios. In the spreadsheet I have  "75%" and "90%" figures - these are forecasts which will be greater than the actual figure 75% of the time and 90% of the time respectively. If you inspect the cells, you'll see that they are calculated as:

75%: exp(log(forecast) + 0.6744898*stdev(residuals))
90%: exp(log(forecast) + 1.644854*stdev(residuals))

If the idea of "forecast intervals" is confusing you, just think of these forecasts as your "bad luck" estimate (75%) and your "worse luck" estimate (90%).








2. Calculate expected earnings per Ghps


Plug your data into a spreadsheet - go ahead, give it a try. Either make your own copy of the spreadsheet, or wait your turn if a bunch of people are using it. Once you've played with it for a bit, scroll down and I'll explain how it works.








3. Understanding the income spreadsheet
The percentage change in difficulty is the key to understanding the spreadsheet. If you can forecast difficulty changes, you can forecast not just the next changes in difficulty, but how long each set of 2016 blocks will take.

Column B: Difficulty = last difficulty * percentage change forecast

Column D: Time until next difficulty = 14 days / percentage change forecast

Column F: Income per ghps = 10^9 / 2^32 * time until next retarget / difficulty * reward per block

Column G: Cumulative income per Ghps: cumulative sum of column F

4. Summary
Calculating an estimate for your earnings is not hard if you have the right spreadsheet, but the real skill lies in forecasting difficulty changes. If you don't mind the lack of forecast intervals, then you could try plotting the rate of acceleration/deceleration of difficulty (the change in the rate of change of difficulty) and forecast using a trend-line of some sort.

Alternatively you could just take your historical income, and bypass the whole step function funkiness that comes with difficulty forecasts - which is what I'll do next post - except without a spreadsheet (oh happy day!).




Organofcorti lives!

organofcorti.blogspot.com is a reader supported blog:

1QC2KE4GZ4SZ8AnpwVT483D2E97SLHTGCG

Find a typo or spelling error? Email me with the details at organofcorti@organofcorti.org and if you're the first to email me I'll pay you per ten errors:



Please refer to the most recent blog post for current rates or rule changes.

I'm terrible at proofreading, so some of these posts may be worth quite a bit to the keen reader.
Exceptions:
  • Errors in text repeated across multiple posts: I will only pay for the most recent errors rather every single occurrence.
  • Errors in chart texts: Since I can't fix the chart texts (since I don't keep the data that generated them) I can't pay for them. Still, they would be nice to know about!
I write in British English.



No comments:

Post a Comment

Comments are switched off until the current spam storm ends.