How to predict next value using time series?

WT · Jun 13, 2022 · 2.4K views
Question
Hi, is there a way to use neural network toolbox to predict the next value in a time series?
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Aug 18, 2026
  1. Override 'dividerand' to obtain constant intervals between points. For example

 

net.divideFcn = 'divideblock'

2. Obtain the final states Xf,Af from training

 

[ net tr Ys Es Xf Af] = train(net,Xs,Ts,Xi,Ai);

   %Ys = net(Xs,Xi,Ai); 
   %Es = gsubtract(Ts,Ys);

3. You have to know the new initial state conditions Xinew, Ainew to predict points after the original data; Then

 

   Ynew = net(NaN(n),Xinew,Yinew))

will yield n predictions. If Xinew,Ainew = Xf,Af, then Ynew is a gapless contnuation of Ys.

Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!