|
6 | 6 | "source": [ |
7 | 7 | "## Bitcoin XBTUSD\n", |
8 | 8 | "\n", |
9 | | - "We demonstrate how easily Bitcoin data can be statistically analyzed \n", |
| 9 | + "Federal Reserve Chairman Ben Bernanke in his 6 September 2013 letter \n", |
| 10 | + "to a Senate committee stated that Bitcoin and other virtual currencies \n", |
| 11 | + "\"*may hold long-term promise, particularly if the innovations\n", |
| 12 | + "promote a faster, more secure and more efficient payment system*.\" \n", |
| 13 | + "[See http://goo.gl/49I5ZI for the full letter.] \n", |
| 14 | + "\n", |
| 15 | + "Here demonstrate how Bitcoin data can be statistically analyzed \n", |
10 | 16 | "by fecon235 as a financial asset.\n", |
11 | 17 | "\n", |
12 | 18 | "- 2016-12-30 The annualized volatility is 112%, which is astonishing. \n", |
13 | 19 | "This implies (within less than one standard deviation) that it is \n", |
14 | 20 | "equally probable in the coming year that Bitcoin will be \n", |
15 | 21 | "totally worthless or roughly double in price.\n", |
16 | 22 | "\n", |
| 23 | + "**This high volatility may hinder its general acceptance as a means of payments.** \n", |
| 24 | + "It role as store of value is speculative, but it may provide \n", |
| 25 | + "diversification to a portfolio (see Appendix 1).\n", |
| 26 | + "\n", |
| 27 | + "- For comparative valuation, we investigate XBTXAU (in terms of gold troy ounces) and XBTCNY (in terms of Chinese yuan, due to predominant Bitcoin mining activity in China). \n", |
| 28 | + "\n", |
| 29 | + " - As of 2017-02-07, one Bitcoin was insufficient to buy one troy ounce \n", |
| 30 | + "of gold, but the peaks of XBTXAU indicates temporary surge efforts \n", |
| 31 | + "(all-time high was 0.945 troy ounces on 2017-01-05 \n", |
| 32 | + "which is comparable to the 2013-12-04 record).\n", |
| 33 | + "\n", |
17 | 34 | "\n", |
18 | 35 | "- The upper bound on the number of Bitcoins is 21 million. \n", |
19 | | - "This limit has economic consequences [to be discussed, perhaps in another notebook]." |
| 36 | + "This limit has economic consequences [to be discussed, perhaps in another notebook].\n", |
| 37 | + "\n", |
| 38 | + "In 2013, the Foreign Exchange team at Bank of America (David Woo, Ian Gordan, et al.) \n", |
| 39 | + "produced its first assessment in an extensive 14-page report:\n", |
| 40 | + "\"our fair value analysis implies a maximum market capitalization of Bitcoin \n", |
| 41 | + "of \\$15bn (1 BTC = 1300 USD).\" Capitalization is in fact currently about 16 billion USD, \n", |
| 42 | + "and we provide the means to compute that statistic.\n" |
20 | 43 | ] |
21 | 44 | }, |
22 | 45 | { |
|
49 | 72 | " \n", |
50 | 73 | "*CHANGE LOG*\n", |
51 | 74 | "\n", |
| 75 | + " TODO [ ] Add XBTCNY analysis.\n", |
| 76 | + " 2017-02-07 Add references. Use newly defined quandlcodes.\n", |
52 | 77 | " 2016-12-31 First version." |
53 | 78 | ] |
54 | 79 | }, |
|
107 | 132 | "source": [ |
108 | 133 | "## Bitcoin data\n", |
109 | 134 | "\n", |
110 | | - "We first define some Quandl symbols used by Blockchain, \n", |
111 | | - "then retrieve selected data.\n", |
112 | | - "\n", |
113 | | - "Source: https://www.quandl.com/data/BCHAIN-Blockchain\n", |
114 | | - "which also offers:\n", |
| 135 | + "Source: https://www.quandl.com/data/BCHAIN-Blockchain which also offers:\n", |
115 | 136 | "\n", |
116 | 137 | "- Number of Unique Bitcoin Addresses Used\n", |
117 | 138 | "- Total Number of Transactions\n", |
118 | 139 | "- Average Transaction Confirmation Time\n", |
119 | | - "- Miners Revenue\n" |
120 | | - ] |
121 | | - }, |
122 | | - { |
123 | | - "cell_type": "code", |
124 | | - "execution_count": null, |
125 | | - "metadata": { |
126 | | - "collapsed": true |
127 | | - }, |
128 | | - "outputs": [], |
129 | | - "source": [ |
130 | | - "# These may get defined globally in the main module.\n", |
131 | | - "\n", |
132 | | - "d4xbt = 'BCHAIN/MKPRU' # Price in USD (approx. $960)\n", |
133 | | - "d4xbtN = 'BCHAIN/TOTBC' # Number of Bitcoins (approx. 16 million)\n", |
| 140 | + "- Miners Revenue\n", |
134 | 141 | "\n", |
135 | | - "# d4xbtCap = 'BCHAIN/MKTCP' # Market capitalization (approx. 16 billion USD)\n", |
136 | | - "# This series can be largely replicated by multiplying the forementioned." |
| 142 | + "We pre-defined quandcodes for Bitcoin count and USD price." |
137 | 143 | ] |
138 | 144 | }, |
139 | 145 | { |
|
144 | 150 | }, |
145 | 151 | "outputs": [], |
146 | 152 | "source": [ |
147 | | - "xbt = get( d4xbt )\n", |
148 | | - "xbtN = get( d4xbtN )" |
149 | | - ] |
150 | | - }, |
151 | | - { |
152 | | - "cell_type": "code", |
153 | | - "execution_count": null, |
154 | | - "metadata": { |
155 | | - "collapsed": false |
156 | | - }, |
157 | | - "outputs": [], |
158 | | - "source": [ |
159 | | - "dflist = [xbt, xbtN]\n", |
| 153 | + "# d7 means frequency of 7 days per week:\n", |
| 154 | + "xbt = get( d7xbtusd ) # Bitcoin price in USD (approx. 960 USD)\n", |
| 155 | + "xbtN = get( d7xbtcount ) # number of Bitcoins mined thus far (approx. 16 million)\n", |
160 | 156 | "\n", |
161 | | - "for df in dflist:\n", |
162 | | - " df.index.names = ['T']\n", |
163 | | - " df.columns = ['Y']\n", |
164 | | - " # These names are fecon235 conventions." |
| 157 | + "# Market capitalization will computed by multiplying the two: approx. 16 billion USD.\n", |
| 158 | + "# Double check: d4xbtCap = 'BCHAIN/MKTCP' " |
165 | 159 | ] |
166 | 160 | }, |
167 | 161 | { |
|
232 | 226 | "and unclaimed rewards, the maximum number of Bitcoins is \n", |
233 | 227 | "technically 20999999.9769.]\n", |
234 | 228 | "\n", |
235 | | - "Currently about 98% of Bitcoin mining originates from China." |
| 229 | + "**Currently about 98% of Bitcoin mining originates from China.** \n", |
| 230 | + "David Woo at Bank of America back in 2013 pointed out: \n", |
| 231 | + "\"The correlation between CNY’s share of volume of all Bitcoin exchanges \n", |
| 232 | + "and price of Bitcoin is high and rising.\" \n", |
| 233 | + "Later we shall investigate Bitcoin's relationship to \n", |
| 234 | + "the Chinese yuan." |
236 | 235 | ] |
237 | 236 | }, |
238 | 237 | { |
|
281 | 280 | }, |
282 | 281 | "outputs": [], |
283 | 282 | "source": [ |
284 | | - "# Append xbtCap to dflist:\n", |
| 283 | + "# List of dataframes:\n", |
285 | 284 | "dflist = [xbt, xbtN, xbtCap]\n", |
286 | 285 | "\n", |
287 | 286 | "# Create Bitcoin DataFrame:\n", |
|
450 | 449 | "cell_type": "markdown", |
451 | 450 | "metadata": {}, |
452 | 451 | "source": [ |
453 | | - "## Relationship to Gold, XAU\n", |
| 452 | + "## Relationship to Gold: XAU\n", |
454 | 453 | "\n", |
455 | 454 | "First we investigate whether any linear relationship \n", |
456 | | - "exists between XBT and XAU. We shall rely on Python's *pandas* \n", |
457 | | - "to handle the date alignment correctly in our regression analysis." |
| 455 | + "exists between XBT and XAU, the perennial store of value. \n", |
| 456 | + "We shall rely on Python's *pandas* to handle the date alignment \n", |
| 457 | + "correctly in our regression analysis." |
458 | 458 | ] |
459 | 459 | }, |
460 | 460 | { |
|
478 | 478 | "outputs": [], |
479 | 479 | "source": [ |
480 | 480 | "# We shall use the fitted XBT price in our regression:\n", |
481 | | - "stat2( xbtema[begin:]['Y'], xau[begin:]['Y'] )\n", |
482 | | - "\n", |
483 | | - "# Our time index T is used for date alignment." |
| 481 | + "stat2( xbtema[begin:]['Y'], xau[begin:]['Y'] )" |
484 | 482 | ] |
485 | 483 | }, |
486 | 484 | { |
|
560 | 558 | "will look very similar since the correlation between the two \n", |
561 | 559 | "ranges from 0.97 to 0.99 depending on the time frame.\n", |
562 | 560 | "\n", |
563 | | - "As of 2016-12-30, one Bitcoin was insufficient to buy one troy ounce \n", |
| 561 | + "As of 2017-02-07, one Bitcoin was insufficient to buy one troy ounce \n", |
564 | 562 | "of gold, but the peaks of XBTXAU indicates temporary surge efforts \n", |
565 | | - "(all-time high was 0.926 troy ounces on 2013-12-04)." |
| 563 | + "(all-time high was 0.945 troy ounces on 2017-01-05 \n", |
| 564 | + "which is comparable to the 2013-12-04 record)." |
| 565 | + ] |
| 566 | + }, |
| 567 | + { |
| 568 | + "cell_type": "markdown", |
| 569 | + "metadata": { |
| 570 | + "collapsed": true |
| 571 | + }, |
| 572 | + "source": [ |
| 573 | + "---\n", |
| 574 | + "\n", |
| 575 | + "## Appendix 1: Reference notes\n", |
| 576 | + "\n", |
| 577 | + "- Brière M., K. Oosterlinck and A. Szafarz, “*Virtual Currency, Tangible Return: Portfolio Diversification with Bitcoins*\", SSRN Working Paper N°2324780, 2013. http://goo.gl/40VIxr\n", |
| 578 | + "\n", |
| 579 | + "Despite the extreme volatilty, Brière et al. claim Bitcoin-inclusive portfolios \n", |
| 580 | + "will deliver superior mean-variance trade-offs than similar BTC-free portfolios. \n", |
| 581 | + "They proposed about 3% BTC inclusion.\n", |
| 582 | + "\n" |
566 | 583 | ] |
567 | 584 | }, |
568 | 585 | { |
|
591 | 608 | "name": "python", |
592 | 609 | "nbconvert_exporter": "python", |
593 | 610 | "pygments_lexer": "ipython2", |
594 | | - "version": "2.7.11" |
| 611 | + "version": "2.7.13" |
595 | 612 | } |
596 | 613 | }, |
597 | 614 | "nbformat": 4, |
|
0 commit comments