Bitcoin Forum
June 14, 2024, 04:00:14 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Benford's Law?  (Read 1581 times)
phatsphere (OP)
Hero Member
*****
Offline Offline

Activity: 763
Merit: 500


View Profile
May 26, 2014, 01:05:23 PM
 #1

Has anyone so far looked into Benford's Law for the highest mantissa digits of all prices? It's kind of a rule, that for arbitrary numbers and prices, the highest digit tends to be the digit 1 or 2, but not 7, 8 or 9.
What the script below does: daily average since 2011 from blockchain.info, do some transformations with pandas, and then plot it. It almost fits, but a bit too much for 1 and not enough for 2 and 3.

Based on that, I speculate that we'll either see a long period of $ 200-299  or $ 2000-2999.

Ideas welcome, improvements are certainly possible ...



Code: (python)
#!/usr/bin/env python
import numpy as np
import pandas as pd

pricedata = "http://blockchain.info/charts/market-price?showDataPoints=false&timespan=all&show_header=true&daysAverageString=1&scale=0&format=csv"
data = pd.read_csv(pricedata, names = ["day", "price"], parse_dates=[0], index_col=0)

#start at 2011-01-01
data = data.ix['2011-01-01':]
print data.head()

price100 = data["price"] * 100
pcolstr = price100.map(str)
highest = pcolstr.map(lambda _ : _[0]).map(int)

print highest.describe()
val, _ = np.histogram(highest.as_matrix(), bins=9)

digits = np.arange(1,10)
benford = np.log10(1 + 1. / digits)

vals = val.astype(np.float) / highest.size

print(np.c_[benford, vals])

import matplotlib.pyplot as plt
plt.plot(digits, benford)
plt.plot(digits, vals, color="green")
plt.show()
jamesc760
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250



View Profile
May 26, 2014, 01:24:36 PM
 #2

I've been speculating that the end of 2014 price will be around $2500, after a rise to $5000.
frienemy
Full Member
***
Offline Offline

Activity: 235
Merit: 100

I was promised da moon


View Profile
May 26, 2014, 01:26:17 PM
 #3

In case of a "bubble" this year, the subsequent correction to a 2000ish level and a slow advance from there would pretty much fit into this picture. One of the explanations for Benford's Law is exponential growth anyway, isn't it?

MCTRL_751 >   END OF LINE
OnkelPaul
Legendary
*
Offline Offline

Activity: 1039
Merit: 1004



View Profile
May 26, 2014, 01:39:29 PM
 #4

Benford's law basically describes the distribution of first digits in a data set with exponential variation. Since the price curve of bitcoin approximately follows an exponential curve, the law applies to bitcoin prices relatively well.
However, as with all real-world data for which an approximate mathematical model exists, future datapoints will not be skewed to "fill" differences between historical datapoints and the model.
So while it is very likely that future prices will more often have 1, 2 or 3 as their first digit than 7, 8 or 9, there is no reason to believe that 2 will be more common in future since it was a bit less common in the past.
This is similar to dice throws: Just because you did not roll a 6 for a number of times does not make it more probable that your next roll will be a 6.

On the contrary: It might be possible that a mechanism is at work that somehow makes 2 less probable, so after going through 1000..1999 the time for 2000..2999 might be much shorter due to psychological effects.

Onkel Paul

pinksheep
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
May 26, 2014, 01:48:09 PM
 #5

Has anyone so far looked into Benford's Law for the highest mantissa digits of all prices? It's kind of a rule, that for arbitrary numbers and prices, the highest digit tends to be the digit 1 or 2, but not 7, 8 or 9.
What the script below does: daily average since 2011 from blockchain.info, do some transformations with pandas, and then plot it. It almost fits, but a bit too much for 1 and not enough for 2 and 3.

Based on that, I speculate that we'll either see a long period of $ 200-299  or $ 2000-2999.

Ideas welcome, improvements are certainly possible ...



Code: (python)
#!/usr/bin/env python
import numpy as np
import pandas as pd

pricedata = "http://blockchain.info/charts/market-price?showDataPoints=false&timespan=all&show_header=true&daysAverageString=1&scale=0&format=csv"
data = pd.read_csv(pricedata, names = ["day", "price"], parse_dates=[0], index_col=0)

#start at 2011-01-01
data = data.ix['2011-01-01':]
print data.head()

price100 = data["price"] * 100
pcolstr = price100.map(str)
highest = pcolstr.map(lambda _ : _[0]).map(int)

print highest.describe()
val, _ = np.histogram(highest.as_matrix(), bins=9)

digits = np.arange(1,10)
benford = np.log10(1 + 1. / digits)

vals = val.astype(np.float) / highest.size

print(np.c_[benford, vals])

import matplotlib.pyplot as plt
plt.plot(digits, benford)
plt.plot(digits, vals, color="green")
plt.show()

So do you think after that we'll have a long period with the price around $20,000-$29,999?

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
PRIMEDICE
The Premier Bitcoin Gambling Experience @PrimeDice
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
phatsphere (OP)
Hero Member
*****
Offline Offline

Activity: 763
Merit: 500


View Profile
May 26, 2014, 02:05:07 PM
 #6

This is similar to dice throws: Just because you did not roll a 6 for a number of times does not make it more probable that your next roll will be a 6.
Don't be confused with "gambler's fallacy". What I've posted doesn't concern a single event, but the overall summary.
phatsphere (OP)
Hero Member
*****
Offline Offline

Activity: 763
Merit: 500


View Profile
May 26, 2014, 02:06:05 PM
 #7

So do you think after that we'll have a long period with the price around $20,000-$29,999?
Well, if the "2" and "3" are filled up, miraculously, in the near future ... there is absolutely no implication for the far future. Hence no.
Foxpup
Legendary
*
Offline Offline

Activity: 4396
Merit: 3062


Vile Vixen and Miss Bitcointalk 2021-2023


View Profile
May 27, 2014, 01:03:54 AM
 #8

Classic gambler's fallacy. "I'm more likely to roll a two, because I pre-rolled the ones out." Roll Eyes

So do you think after that we'll have a long period with the price around $20,000-$29,999?
Of course. It'll certainly last longer than the $30,000-$39,999 range... because $20k-$30k is a 50% increase, but $30k-$40k is only a 33% increase. (How do you think Benford's law works in the first place?)

Will pretend to do unspeakable things (while actually eating a taco) for bitcoins: 1K6d1EviQKX3SVKjPYmJGyWBb1avbmCFM4
I am not on the scammers' paradise known as Telegram! Do not believe anyone claiming to be me off-forum without a signed message from the above address! Accept no excuses and make no exceptions!
Alonzo Ewing
Legendary
*
Offline Offline

Activity: 1040
Merit: 1001


View Profile
May 28, 2014, 05:06:03 AM
Last edit: May 28, 2014, 05:46:48 AM by Alonzo Ewing
 #9

This is awesome.  Thank you for posting this and teaching me something.

I'm wondering if you add an analysis: the number of consecutive days in various groupings:

Group 1: 1 and 2 first digit
Group 2: 2, 3, 5 first digit
Group 3: 6-9 first digit

When I look back at the long term chart, there's really only been two periods when there were numerous consecutive days (weeks actually) with the first digit between 6 and 9: back in 2011 when the price ranged from 0.5 through 0.9, and the last 5-6 months.

Edit: Actually, you don't necessarily need to break it down into groups--using the same single number histogram is fine.  What I'm curious about is the consecutiveness of the days (or weeks).
glub0x
Legendary
*
Offline Offline

Activity: 892
Merit: 1013



View Profile
May 28, 2014, 07:21:24 AM
 #10

Makes sens to me. It is really not a obvious one.
But i m not sure you can actually make profit with it, can you?

Thanks for sharing

The cost of mediation increases transaction costs, limiting the
minimum practical transaction size and cutting off the possibility for small casual transactions

Satoshi Nakamoto : https://bitcoin.org/bitcoin.pdf
btc-owl
Newbie
*
Offline Offline

Activity: 47
Merit: 0


View Profile
May 28, 2014, 10:31:03 AM
 #11

The issue with these kind of projections is that the curve can change dramatically when major events occur (as it happens on stock markets when a Tsunami/war/terrorist attacks hits any major hub).

BTC is on its early days, and major announcements are due to come. Either good or bad ones, from frauds to successful startups, volatility will still be around for a while.
DolanDuck
Full Member
***
Offline Offline

Activity: 196
Merit: 101


View Profile
May 28, 2014, 11:06:59 AM
 #12

We'll either see a long period of $ 200-299  or $ 2000-2999, but what are the odds of the low and high price, 50/50?

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
PRIMEDICE
The Premier Bitcoin Gambling Experience @PrimeDice
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!