5

5

I have been reading several papers, articles and blog posts about RNNs (LSTM specifically) and how we can use them to do time series prediction. In almost all examples and codes I have found, the problem is defined as finding the next `x`

values of a time series based on previous data. What I am trying to solve is the following:

- Assuming We have
`t`

values of a time series, what would be its value at time`t+1`

?

So using different LSTM packages (deeplearning4j, keras, ...) that are out there, here is what I am doing right now:

Create a LSTM network and fit it to

`t`

samples. My network has one input and one output. So as for input I will have the following patterns and I call them train data:t_1,t_2

t_2,t_3

t_3,t_4

The next step is to use for example

`t_4`

as input and expect`t_5`

as output then use`t_5`

as input and expect`t_6`

as output and so on.When done with prediction, I use

`t_5,t_6`

to update my model.

My question: Is this the correct way of doing it? If yes, then I have no idea what does `batch_size`

mean and why it is useful.

Note: An alternative that comes to my mind is something similar to examples which generate a sequence of characters, one character at a time. In that case, `batch_size`

would be a series of numbers and I am expecting the next series with the same size and the one value that I'm looking for would be the last number in that series. I am not sure which of the above mentioned approaches are correct and would really appreciate any help in this regard.

Thanks

This does not work with multivariate time series prediction, however, keras has a straightforward implementation for predicting multiple time steps ahead. – Hobbes – 2017-07-17T15:10:15.007