I have multiple time series (about 200) of soil moisture behavior after saturation in different soil types. They are all the same length and nearly the same shape, differing only in their ultimate value and rate of soil moisture decline due to the effects of different soil properties.

What I need is an RNN model that can predict the time series with only one sequence as input. This RNN must be able to detect, at least internally, which of the 200 training sequences the input sequence corresponds to and then predict the next values. Is something like this possible? What I tried was to concatenate all the time series into one and I trained an RNN with 3 layers and different numbers of hidden units, but I didn't get good results. Should I increase the complexity of the model or try a new approach?


1 Answer 1


Yes, you can use a Multivariate RNN.

Multivariate RNN

In this architecture multiple sequential features (i.e., a number of sequneces) as an input to your recurrent layers.

Taking pytorch as a reference, you can see that the input of LSTM object is a tensor of shape $$input = (L, H_{in})$$ where $L$ is the length of your sequences whereas $H_{in}$ is the number of input features* (i.e., a number of sequences). I attach below a couple of resources in case they are helpful:

Hope it helps!

* Input can also have $(L, N, H_{in})$ for $N$ batches.

  • 1
    $\begingroup$ Sorry, I think I was not clear enough. The model must have only one sequence as input, not multiple ones. I have 200 sequences but only for training and each sequence represents the same magnitude but with different soil parameters. Only with the first values of a sequence as input, the model must predict the following values of it. Internally, it must recognize which of the 200 sequences it belongs to in order to predict the correct behavior. $\endgroup$
    – soilwatch
    Oct 26, 2022 at 13:48
  • $\begingroup$ Hello nw, you would normally train your model using a TRAINSET consisting of multiple datapoints/time-series. For inference, you can use one or multiple datapoints to make a prediction and that would be up to the user. $\endgroup$
    – hH1sG0n3
    Oct 26, 2022 at 14:46

Your Answer

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

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