[PYTHON] Predict Bitcoin price changes with Prophet

Continuing from "Play with Prophet", I tried to predict the transition of the Bitcoin price.

Datasets

image.png

image.png

――It seems that the recent trend is that it is on the rise. ――The weekly trend seems to be "buy on Tuesday and sell on Sunday".

It smells like dust, so I'll investigate it a little more.

Performance verification

--Training data: 2017-05-27 ~ 2017-08-31 --Verification data: 2017-09-01 ~ 2017-09-08

Let's check the performance with SMAPE [^ 1].

image.png

image.png

――The tendency of weekly changes just by changing the period a little. What is it? ??

When changepoint_prior_scale = 0.05 (default)

y_true = forecast["y"].values
y_pred = forecast["yhat"].values
print "FORECAST SMAPE: %.3f" % smape(y_true, y_pred)
# FORECAST SMAPE: 4.238

When changepoint_prior_scale = 0.01

y_true = forecast["y"].values
y_pred = forecast["yhat"].values
print "FORECAST SMAPE: %.3f" % smape(y_true, y_pred)
# FORECAST SMAPE: 4.197

A little better than the default

Median validation data over time (reference)

y_median = np.asarray([np.median(y_true)] * len(y_true))
print "MEDIAN SMAPE: %.3f" % smape(y_true, y_median)
# MEDIAN SMAPE: 2.922

I don't know the median value of future data, but I will give it as a guide. The performance is better when using the median, so it seems that the prediction needs to be improved.

Summary

--Predict Bitcoin price changes using Prophet --The weekly tendency seems unreliable as it changes with slight fluctuations over a period of time. --Is there any improvement by finding the optimum parameters for changepoint_prior_scale?

References

Recommended Posts

Predict Bitcoin price changes with Prophet
Try Bitcoin Price Forecasting with Deep Learning
Play with Prophet
Predict the number of people infected with COVID-19 with Prophet
Predict candlesticks with artificial intelligence
Bitcoin price monitor python script
Stock price forecast with tensorflow
Get stock price with Python