Time Series Prediction,
by use of Deep learning Bi-Long Short Memory (bi-LSTM) Network
And shallow learning simple Feedforward Network.
input data should be an excel file with one column.
I’ve to Thank my dear friend Dr. S.Mostapha Kalami Heris for his
code in “PlotResults” function.
If you have questions or would like to improve the code, don't hesitate
to mail me: email@example.com
23 Nov 2018
Abolfazl Nejatian (2020). Time Series Prediction (https://www.mathworks.com/matlabcentral/fileexchange/69506-time-series-prediction), MATLAB Central File Exchange. Retrieved .
I faced a problem
Reference to non-existent field 'XTs'.
Error in timeSeriesPrediction_1>evaluateNet (line 275)
TestOutputs = (predict(results.Net,data.XTs,'MiniBatchSize',opt.miniBatchSize));
Error in timeSeriesPrediction_1 (line 72)
results = evaluateNet(results,data,opt);
What about the forecasting data? where could i see those?
Same question as Ali, please include the xlsx sample data file. It's missing in the zip downlaod. Thanks!
The code is nice - as mentioned before the calculation of mean and std should be applied only to train data. It could also be improved by adding selectable multiple steps ahead predictions capability into general parameters section of the code.
Hi, I'm begginer in Matlab.
How I can use the code to forecast the future time series? I can read test data, but I want find 10-12 future series.
in 'results' variable I see only compare beetween targets and outputs for test data.
Hello, the following error occurred while I was running
The function or variable 'sequenceInputLayer' is not defined.
Error LSTMArchitect (line 14)
Error main4 (line 44)
Opt = LSTMArchitect(opt);
Hello, I feel the code needs to be
changed. It seems that it can read the test data and tune the model accordingly. It should not be in a practical case.
Abolfazl is a nice and helping person. He tries to help with the code.
Thank you for sharing the code, but i have a problem when trying to run it, i have this error massage :
Struct contents reference from a non-struct array object.
Error in timeSeriesPrediction (line 44)
could you help please.
thanks in advance
data file (.xlsx) ? Can anyone upload data file as a reference?
i discussed the code with other experts and I can confirm that Victor Plaza is right. The code assumes that the mean and deviation for test set is known, which is not possible and unsuitable for a real-time forecasting
I think your code is biased from the beginning. You are normalizing the data previously to split it into training and testing.
That implies you know the mean and the standard deviation of the testing set, what is false. You need to calculate these measures for the training set, what is what you will have in online processing, and later apply it to the testing set.
Calculating them over the whole data set allows the LSTM to access data that is actually unavailable.
Thank you for posting this code. I have a question regarding the possibility of multistep ahead predictions using this code.
I see that the delays can be used to train the LSTM on several step ahead data. The test set is also prepared in a similar manner. It seems that the predictions are N- step ahead where N would be max(Delays)+1. But when i observe the results in my case, it does not seem to be the case.
I would kindly request you to give an interpretation (with respect to prediction horizon) for the plot showing 'all data'.
I have a time series with of length 720 samples with 30 sec interval between two consecutive samples. I am basically trying to: (i) get predictions for one hour ahead (ii) given the time series, predict 'n' further steps of that series.
Thank you for your time!
dear @Eduardo Santos
by downloading the updated code, you can find output data on the workspace in 'results' variable.
How may I see the forecast data? I mean... How do interpret the script output data?
save outputs data on the workspace.
fix some minor bugs
fix some minor bogs