In order to try what i learned about LSTM, i downloaded a simple bitcoin price dataset, and tried to make a network which predicts the bitcoin price by feeding a sequence of price history.

Looking for this topic on Google, it seems a lot of people have tried it, and they get the same results as I do : the LSTM seems to learn the identity function. Indeed i remarked that when predicting the prices with LSTM, the predicition seems to be the original price curve, but shifted to the right. (basically the LSTM just repeat the last known price)

And this is kind of logical, if you were to try to predict the current price of bitcoin given the previous prices, just by repeating the last known price you would be close to truth a lot of times.

I have tried changing my loss function in order to avoid the network to learn the identity function, but it didn't work. Has any work been done on that before ? Is it a known issue ? All the blog article which were using LSTM didn't mention it, tho it was obvious from their graphs... (e.g. http://www.quantatrisk.com/2020/04/01/how-to-predict-bitcoin-price-deep-learning-lstm-network-python/ prediction at the end)


1 Answer 1


I'm not particularly expert in this but I'm quite sure that the variations in the price of anything depend mostly on external factors: news of the day, economic indicators, stockmarket movements, etc.

As a rule of thumb, if a human with a lot of time can't do it, usually a ML model can't do it either. In this case if an expert in finance is given the history of the price but no access to any other information I doubt they can predict anything other than a conservative guess that the price will stay the same.

I don't see how the model can do anything better than this without some good indicators as features, and probably it would need a large number of complex indicators. For example I would assume that news like these affect the Bitcoin price, but gathering this kind of information and integrating it into a model certainly requires a lot of work.

  • $\begingroup$ I fully agree with you on the fact that my network needs more than history prices in order to predict future price, and i wasn't expecting my network to guess the good prices for the future, but still I find it strange that it doesn't learn any pattern from chaos, even by adding some random noises my model always end up guessing the same price for the future $\endgroup$
    – lairv
    Dec 29, 2020 at 16:37
  • $\begingroup$ @lairv actually it can be seen as good news: your model correctly discards all the noise. Normally a pattern in statistics is the opposite of noise/chaos, it must have some kind of regularity. A model which extracts rules from random observations is overfit. $\endgroup$
    – Erwan
    Dec 29, 2020 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.