How to predict next value using time series?

Illustration
WT - 2022-06-13T15:20:59+00:00
Question: How to predict next value using time series?

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 answered . 2025-11-20

  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.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!