I have several sequences of univariate real-valued time-series data. The sequences are of different lengths and right now I cannot batch them and feed them to a network. What is the correct procedure to pad these sequences? Is it even possible in this case since I can't use any number as a special symbol?


I'm working with arbitrary univariate time-series data (not related to one specific domain, unbounded range). To give example of one such a series consider standardized stock dataset (only first 10 elements shown):

d = array([-0.37807043, 0.14321786, -0.37807043, 0.13478392, 0.18733381,
   1.19576774, 0.25675156, 0.26064414, 0.30930144, 0.38650436])
  • $\begingroup$ Welcome to the site! I think your question is open ended, can you give some example or sample sequence for better understanding. Accordingly we can suggest you better. Thank you! $\endgroup$ – Toros91 Mar 21 '18 at 5:39
  • $\begingroup$ Updated my question. However, the time-series I'm working with are arbitrary. $\endgroup$ – Aechlys Mar 21 '18 at 6:15
  • $\begingroup$ I think that combining such data together is not going to give you good insights. In the scenarios where you want to combine different time series data, you need to check for the trend of the data and if they both are similar then it makes sense to combine them or else it is very wrong to do it. $\endgroup$ – Toros91 Mar 21 '18 at 6:19
  • $\begingroup$ My aim is to implement a time-series autoencoder presented in a conference paper and later use these seq-embeddings to improve classification/regression performance. $\endgroup$ – Aechlys Mar 21 '18 at 6:28
  • $\begingroup$ hmm I understand, even I'm also working on something similar, since I don't have the future values, I forecast the values and these are used for classifying the target outcome. But combining data on which you don't have enough support(proof) is wrong way of doing. This is what I feel. $\endgroup$ – Toros91 Mar 21 '18 at 6:32

How you pad it (and even whether you do so) would depend on what you expect of the data. This imposes boundary conditions on the data which will induce artifacts in any transform you make. How bad this effect depends on how well geared your data is to accepting a particular padding method.

Padding methods include zero padding or a periodic bound.

Padding doesn't have to be done in the time domain. Eg interpolating in the frequency domain and back transforming allows you to extrapolate.

If your analytics has a finite history (eg FIR filters) then you can isolate time regions where padding is unnecessary and draw comparisons therefrom.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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