Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- png(width=1200, height=800)
- par(las=2)
- prices <- c(
- 0.005, 0.005, 0.005, 0.005, 0.005, 0.005,
- 0.005, 0.005, 0.005, 0.005, 0.005, 0.005,
- 0.005, 0.005, 0.005, 0.005, 0.005, 0.008,
- 0.06, 0.065, 0.062, 0.106, 0.27, 0.24,
- 0.39, 0.90, 0.85, 1.50, 6.38, 18.55,
- 14.10, 9.75, 5.76, 3.30, 2.60, 3.51,
- 6.11, 5.06, 4.88, 4.98, 5.06, 6.03,
- 8.04, 10.88, 11.46, 11.58, 11.51, 13.33,
- 16.31, 25.93, 58.14, 115.09, 112.81, 108.39,
- 83.80, 105.80, 124.33, 156.50, 517.00
- )
- months <- 1:length(prices)
- result <- lm(log10(prices) ~ months)
- a <- coef(result)[2]
- b <- coef(result)[1]
- plot(months, prices, type='n', log='y', xaxt='n', yaxt='n',
- xlim=c(0,70), ylim=c(0.005,10000),
- main=sprintf("Bitcoin price trend (y = %f * x - %f)", a, abs(b)),
- xlab="", ylab="Typical price in USD")
- years = 2009 + 0:5
- dates = ISOdate(rep(years, rep(4, length(years))),
- rep(0:3 * 3 + 1, length(years)), 1)
- axis(1, 1:length(dates) * 3 - 2, labels=format(dates, '%b %y'))
- axis(2, 10^(-1:4), 10^(-1:4))
- abline(h=c(1:9 / 100, 1:9 / 10, 1:9, 1:9*10, 1:9 * 100, 1:10 * 1000),
- col="lightgrey")
- abline(v=1:100, col="lightgrey")
- abline(result, col="red")
- lines(months, prices, type="o")
- box()
- dev.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement