5-Days Lead forecasting with LSTM

2 Ansichten (letzte 30 Tage)
Foysol Mahmud
Foysol Mahmud am 4 Jan. 2021
Beantwortet: Anay am 3 Apr. 2025
Hello, I have worked on a problem and used LSTM explained following.
To be clear with my question let me explain the problem I am working on. I have 200 water level timeseries data of river. And I have successfully run the LTSM code which can predict one step ahead forecasting (i.e. as per my knowledge when testing, if I give todays water level data it will predict the next days value).
But I want to it to predict 5 step ahead (i.e. when testing, if I give todays water level data it will predict the value for 5th day)

Antworten (1)

Anay
Anay am 3 Apr. 2025
Hi Foysol,
I understand that you want to train a LSTM model to predict output 5 steps ahead. The example you are currently referring to shows how to train an LSTM model to predict a single element ahead in the sequence.
You can predict next 5 outputs by utilizing the “Closed loop forecasting” method where in order to predict output for time steps t to t + k, you need to have true value for the time step t - 1 only. Then, to make prediction for step i, use the predicted value for time step i – 1 as input.
numPredictionTimeSteps = 5; %Predict for next 5 time steps
Y = zeros(numPredictionTimeSteps,numChannels);
Y(1,:) = Z(end,:);
for t = 2:numPredictionTimeSteps
[Y(t,:),state] = predict(net,Y(t-1,:));
net.State = state;
end
You can refer to the “Closed loop forecasting” section of the “Sequence Forecasting Using Deep Learning Example” by following the below link:
I hope this resolves the issue!

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by