How can I use neural network time series toolbox to actually make predicts?

조회 수: 19(최근 30일)
I am trying to train a neural network to make predictions about the trajectory of a ball. So I have an excel spreadsheet with about 20 trajectories (time, x, y, z for each of them) and I am trying to train it so that it can predict an entire trajectory based upon the initial condition given to it (initial time is 0 for all of them, as is initial x since they are all starting at the same spot).
I have been doing the following :
nnstart --> Time Series App --> Nar --> Load data --> train.
I create the Matlab Matrix only function and then the simple script. But how can I actually use this to make predictions? All of the manuals and tutorials are very vague at this part. They pretty much show you how to train it and validate that it works on data it hasn't seen, but doesn't actually tell you how to use it to make predictions, even in the examples that it gives. Ideally I would like to give it the initial state (time = 0, x = 0, y = y0, z = z0) and then it populates the rest of the trajectory until it reaches x=10. I can give it data for delay states if needed
Thank you so much!


Sanjana Ramakrishnan
Sanjana Ramakrishnan 2017년 5월 3일
Refer the below example code for predicting using Neural Network:
1) Load the simple time-series prediction data and create a NAR network.
T = simplenar_dataset;
net = narnet(1:2,10);
2)Prepare the time series data using preparets and train the network:
[Xs,Xi,Ai,Ts] = preparets(net,{},{},T);
net = train(net,Xs,Ts,Xi,Ai);
3)Calculate the network performance.
[Y,Xf,Af] = net(Xs,Xi,Ai);
perf = perform(net,Ts,Y)
4)To predict the output for the next 20 time steps, first simulate the network in closed loop form.
[netc,Xic,Aic] = closeloop(net,Xf,Af);
5)To simulate the network 20 time steps ahead, input an empty cell array of length 20. The network requires only the initial conditions given in Xic and Aic.
y2 = netc(cell(0,20),Xic,Aic)
  댓글 수: 2
Muhammad Usman Saleem
Muhammad Usman Saleem 2023년 5월 14일 10:30
Have you find solution to predict fututre values?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by