How artificial intelligence can predict the bitcoin price

01CryptoHouse
01CryptoHouse
Published in
3 min readJan 18, 2018

As the popularity of various cryptocurrencies rises, it becomes more and more interesting to make their price forecasts. Research groups all around the world work on new artificial intelligence tools for time series forecasting, so we have decided to test how some of them perform on the bitcoin price.

To do this we obtained time series of both the bitcoin price and of people’s interest in bitcoin (from the google trends). We split the time series into two parts. First approximately 600 days were used for cross-validation and optimization of each algorithm, whilst the recent history was used to test their results and to make future predictions. To quantify the results, we had to choose a metric. RMSE (root mean square error) was appropriate in this case. Each time we made a 14-days forecast.

As a benchmark we used the linear regression with a single parameter, which was the current price of bitcoin:

Testing predictions are shown by the orange line, while blue and green lines correspond to the real price and forecasted prices respectively. RMSE of $452, which corresponds to a relative error of 15.47%, was in this case obtained simple by extending the trend from recent history (if the price surged it was naively predicted to surge even more) and so any good forecasting algorithm should reach a lower error.

The next algorithm to be tested was an array of decision trees. They work by searching for a past data point which is the most similar to current data and basing the prediction on the data. While this is clearly optimal for periodic function it is difficult to make predictions of a rising trend. A closer look at the bitcoin price time series suggests there are repeating patterns which can be taken advantage of. The time series in the cross-validation region can be approximated by an exponential which is invariant to multiplication by a constant (i.e. the time series looks the same when its values are multiplied by a constant).

Following this assumption, we augmented the training data set and used it to make a model yielding the following result:

While the RMSE of $344 (or 10.30% in relative numbers) is slightly better than the prediction made by the linear regression it is worth noting that the general shape was better predicted by the decision trees. Even though the model was optimized on the cross-validation region it did not overshoot the recent peak as much as the linear regression did. It is also worth noting that the model did predict the current price drop though we have to keep in mind that given the relative RMSE this may have been only a coincidence.

Hence the decision tree model makes a better prediction than a naive linear regression. Although it makes a better prediction, we must keep in mind that this model as well as any other, no matter how sophisticated, is mostly based on the past data and so it is very susceptible to new factors such as government decisions. Thus any investment decision should not be based purely on such forecasts.

Next time we will make a similar prediction using a neural network.

Michal Racko, data scientist 01CryptoHouse

--

--

01CryptoHouse
01CryptoHouse

The Select team of professionals and blockchain enthusiasts, experienced in blockchain business strategies, crypto development, security or smart contract.