3

I am trying to fit and test LSTM on a numeric series(like stock prices). But it seems that I always get a lag in predicted graph(Blue) with respect to real graph(red). Does anyone know why this happened? (I searched and realized this is a problem for others too).

enter image description here

I use Keras.sequential.LSTM library.

naive
  • 388
  • 1
  • 9
user3486308
  • 1,260
  • 5
  • 16
  • 27
  • 1
    It would be easier to understand your problem and help you if you can provide the code too! – naive Feb 25 '19 at 14:05

1 Answers1

1

I've had similar results when working with time series data. My conclusion was that the model does not learn any real pattern, except that the next value is pretty close to the previous one (or a smoothing of previous ones) + some noise.

This can be easily verified, if you feed your model's predictions recursively into the model to further predict the future (multi-step ahead forecasting based on the model's predictions). In the above mentioned case, your predictions will explode exponentially pretty quickly.