Predicting future values in LSTM for time series

I've been following this tutorial -
And implemented it succesfully too, I wanted to know if i can predict future values (beyond the last date in my time series data), if yes, then how to do it?
Like I have time series data for 90 days, so if i use this model, then It will divide the data into training and testing and then we can get a forecast for testing data but say if i want to find out the prediction for 100th day, how to do it?

5 Comments

Hello, did you find the answer to the question above? I'm also very interested in knowing how to predict the future values using LSTM method.
Thanks,
dear Aman,
i hope you are fine.
well, you have done this prediction once and it is not really complicated!
as you predict data for your current samples, you can easily predict future samples.
just consider delay(s) for your data and then the minimum delay will explain your prediction horizon.
for instance, if your sequence samples (time series data) is,
1.1 2.8 3.9 1.3 4.5 5.3 6.0 9.1
delay one will be formed your input/target data like below,
Input = 1.1 2.8 3.9 1.3 4.5 5.3 6.0
Target = 2.8 3.9 1.3 4.5 5.3 6.0 9.1
so by giving 1.1 to the network, we anticipate network predict 2.8( which is the next value)
and finally, by giving 9.1 to the network, we anticipate network predict the next future sample(what excatly you want)
Thank you for your reply @Abolfazl, I could understand what your trying to explain, but honestly, I'm quite new in these this so it was difficult to exactly understand the code and how to change it for future values.
But after taking a close look at the workspace in matlab and understanding the erros, somehow i ended up changing these lines of code and I was able to forecast future values
dataTrain = data(1:numTimeStepsTrain+1);
dataTest = data(numTimeStepsTrain+1:end);
YTest = dataTest(2:end);
idx = numTimeStepsTrain:(numTimeStepsTrain+numTimeStepsTest);
My change -
train=data(1:num_steps_train);
test=data(num_steps_train-4:end); %for future 5 days, for 10 days -> num_steps_train-9 and so on...
YTest=test(1:end);
idx=num_steps_train:(num_steps_train+num_steps_test+1);
I hope this helps you as well Lynn
can you upload the full code please, i am having some trouble with rmse calculation, changing ytest gives error "Matrix dimensions must agree." the full code can give me a better understanding for my case. Aman Swaraj
Could you upload the full code, i am facing a problem, thanks

Sign in to comment.

Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Asked:

on 20 Apr 2020

Commented:

on 12 Aug 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!