# Checking for stationarity in LSTM

An author in his blog checked for stationarity and removed them in a forecasting problem for using LSTM.I asked others and they said no need to check for it in LSTM.I read some articles and it looked like they need to be checked in ARIMA model.Do we have to check for it in LSTM??

In principle no you do not need to check for stationarity nor correct for it when you are using an LSTM.

The thing about stationarity is that it makes prediction tasks much more efficient, and stable. Think about stationarity in terms of a target. When what you are trying to predict is not stationary, it is like trying to shoot a moving target. It isn't impossible to do, but there is a better way to do things.

If you are trying to predict a stationary variable, then what you are trying to do is hit a non-moving, for lack of a better word, stationary target. It is staying in the same spot relative to you.

Correcting for non-stationarities in an ARIMA model is necessary because it is one of the fundamental assumptions that you make about that particular model. LSTMs do not make that assumption. So you don't have to do it with an LSTM. Seems like the answer to your question is the same as what the people you asked originally. Case closed, right?

Well... you remember shooting at moving targets is much more difficult than shooting at a stationary target right? You may want to force stationarity on a problem that you are going to run against an LSTM, simply because you may be able to eek out a little bit more performance by making it easier for the neural network to learn. So although you don't need to do it, it may still be a good idea and give you a boost in performance.

Stationarity is an important factor in determining the model structure for the ARIMA family of models. Some of the reasons for this are discussed in relative depth in this question.

Briefly, the reason that you have to consider the stationarity of the series explicitly when developing a model in the ARIMA family is because the model has to have descriptive power over changing conditions, which you have to make choices to enable.

In contrast, an LSTM is not constrained on this dimension- i.e. a sufficiently trained LSTM with a sufficient architectural descriptive base can determine the changing nature of the time series without the modeler making explicit choices based on that feature of the data.

You WILL want to understand stationarity in some form regardless of this feature, as it will help inform the useful life period of your model as well as lifecycle concerns - i.e. how often it will need to be retrained, what monitoring is necessary in production, etc.