- Determining the trend for Bitcoin prices.
a) We are given the table for the Bitcoin prices for the years 2010 - 2017 in terms of USD. Determine a linear trend line for these prices. The monthly price is for the first day in the month:
Date year-month-day | Bitcoin price in USD |
2010-12-01 | 0.23 |
2011-06-01 | 9.57 |
2011-12-01 | 3.06 |
2012-06-01 | 5.27 |
2012-12-01 | 12.56 |
2013-06-01 | 129.3 |
2013-12-01 | 946.92 |
2014-06-01 | 629.02 |
2014-12-01 | 378.64 |
2015-06-01 | 223.31 |
2015-12-01 | 362.73 |
2016-06-01 | 536.42 |
2016-12-01 | 753.25 |
2017-06-01 | 2452.18 |
Data taken from CoinDesk price page.
b) As per the linear trend line from part a), what is the expected price of Bitcoin in 2020?
c) Discuss whether a linear line is a good indicator for the future price of Bitcoin.
- Electronics shop's sales. Using the data in the electronics shop's sales example, predict the sales for every month of the year 2019.
Analysis:
- Input:
source_code/7/year_bitcoin.r #Determining a linear trend line for Bitcoin
bitcoin_prices = data.frame(
year = c(2010.91666666666, 2011.41666666666, 2011.91666666666, 2012.41666666666, 2012.91666666666, 2013.41666666666, 2013.91666666666, 2014.41666666666, 2014.91666666666, 2015.41666666666, 2015.91666666666, 2016.41666666666, 2016.91666666666, 2017.41666666666),
btc_price = c(0.23, 9.57, 3.06, 5.27, 12.56, 129.3, 946.92, 629.02, 378.64, 223.31, 362.73, 536.42, 753.25, 2452.18)
)
model = lm(btc_price ~ year, data = bitcoin_prices)
print(model)
Output:
$ Rscript year_bitcoin.r
Call:
lm(formula = btc_price ~ year, data = bitcoin_prices)
Coefficients: (Intercept) year
-431962.9 214.7
Trend line:
From the output of the Rscript, we find out that the linear trend line for the price of Bitcoin in USD is:
price = year * 214.7 - 431962.9
This gives us the following graph for the trend line:
As per the trend line, the expected price for Bitcoin for January 1, 2020 is 1731.1 USD.
A linear trend line is probably not a good indicator and price predictor for Bitcoin. This is because of the many factors in play and because of the potential exponential nature often seen in the trends in technology, for example, the number of active Facebook users and the number of transistors in the best consumer CPU under 1000 USD.
There are three important factors that could facilitate an exponential adoption of Bitcoin and thus drive its price upwards:
- Technological maturity (scalability) - the number of transactions per second can ensure an instant transfer, even though many people use Bitcoin to make and receive payments
- Stability - once sellers are not afraid to lose their profits if they receive payments in Bitcoin, they are more open to accept it as currency
- User-friendliness - once ordinary users can make and receive payments in Bitcoin in a natural way, there will not be a technical barrier to using Bitcoin as they would any other currency they are used to.
To analyze the price of Bitcoin, we would have to take much more data into consideration and it is likely that its price will not follow a linear trend.
- We use the 12 formulas from the example, one for each month, to predict the sales for each month in the year 2019:
sales_january = 1.279*(year+0/12) - 2557.778 - 2.401
= 1.279*(2019 + 0/12) - 2557.778 - 2.401 = 22.122
sales_february = 1.279*(2019+1/12) - 2557.778 - 1.358 = 23.272
sales_march = 1.279*(2019+2/12) - 2557.778 - 0.464 = 24.272
sales_april = 1.279*(2019+3/12) - 2557.778 - 0.608 = 24.234
sales_may = 1.279*(2019+4/12) - 2557.778 - 0.165 = 24.784
sales_june = 1.279*(2019+5/12) - 2557.778 - 0.321 = 24.735
sales_july = 1.279*(2019+6/12) - 2557.778 - 0.003 = 25.160
sales_august = 1.279*(2019+7/12) - 2557.778 - 0.322 = 24.947
sales_september = 1.279*(2019+8/12) - 2557.778 - 0.116 = 25.259
sales_october = 1.279*(2019+9/12) - 2557.778 + 0.090 = 25.572
sales_november = 1.279*(2019+10/12) - 2557.778 + 1.833 = 27.422
sales_december = 1.279*(2019+11/12) - 2557.778 + 3.552 = 29.247