# Sliding window and historical data

In my problem I have a longer period of historical data of a time series. I need to predict for some specific points in time in the future. For these points in time five previous values are also available.

So far my approach was to use a sliding window of size five, use lag features and apply machine learning methods.

However I have a feeling that when doing like this I am not exploiting the historical data to the full extent. (The methods see only one sliding window at a time.)

I am now looking for some method (or ideas to design my own) which takes as an input historical data and measurements just before the time point I need to predict for.

Thank you!

• Do you have the same measurements available for the future point in time, for which you already have the 5 mentioned values? – geekoverdose Jun 9 '16 at 13:09
• @geekoverdose Yes, I have exact same data for historical and future points in time. – Beginner Jun 9 '16 at 15:22

As you have the same information available in your past data as for your future data (both in the form of time series), you could use a number of sequence data/time series based model types to predict your target variable. The core difference is that those models "remember" information between samples, so don't only derive the output on from the $N$ input features of the current input, but also from input they've seen before. Such models range from e.g. Hidden Markov Models to Recurrent Neural Networks - but there are many more suitable model types, with different advantages/disadvantages depending on the details of your problem.
• I see, your assumption is that the relation of month $m_1$, $m_2$, $m_3$ to $m_4$ is the same for historical data (5 years ago) and current data. If this assumption is correct, then the model should learn to predict month $m_4$ from $m_1$ to $m_3$ with both historical and current data. I don't see why this should not conceptually be possible using sequence based models (you don't use the 5 years gap explicitly). – geekoverdose Jun 10 '16 at 12:04