using neural network (NARX) to do prediction

3 views (last 30 days)
To whom it may concern,
First of all, Thanks so much for your time to look into my questions. I am trying to use open loop in NN to train my data (a vector for external input and target), and then transform to close loop to make predictions. and followed the example in the website,
http://www.mathworks.com/help/nnet/ug/multistep-neural-network-prediction.html
But I always came across errors at the command 'closeloop', so I did some tests on the data to see how the 'closeloop' command functions. What i did was I ran the code below using some artificially generated data (see the attachment). An interesting thing is that the code below get run well with the data set,
net = narxnet(1:3,1:3,10);
[x,xi,ai,t] = preparets(net,L,{},P);
net2 = train(net,x,t,xi,ai);
[y1,xf,af] = net2(x,xi,ai);
[netc,xi,ai] = closeloop(net2,xf,af);
[y2,xf,af] = netc(L1,xi,ai);
However,as soon as I changed some P value, let's say the first value of P{1,5} from 8 to 80, the command 'closeloop' won't work well immediately. From this test, I don't think that the data organization is wrong, probably it is because something related to the data itself need to meet up some requirement. Am I right? would you help me look into this problem please?
Thanks a lot!
Regards
Jun (<mailto:jun@mail.usf.edu jun@mail.usf.edu>)

Accepted Answer

Greg Heath
Greg Heath on 10 May 2014
I have posted many solutions to narxnet problems. Search the NEWSGROUP and ANSWERS using
greg narxnet
and
greg closeloop.
Hope this helps.
Greg
  2 Comments
jun
jun on 10 May 2014
Edited: jun on 10 May 2014
Hi Dr. Heath,
I searched around the previous questions related to this topic, but I havne't figured out the question yet, I still keeping get error below,when I ran the closeloop using the attached data sets.
Error using mat2cell (line 107)
Input arguments, D1 through D2, must sum to each
dimension of the input matrix size, [1 1].'
Error in nnet7.process_fcn (line 26) if (wasCell), out1 = mat2cell(out1,ii,jj); end
Error in removeconstantrows (line 41) y = nnet7.process_fcn(mfilename,x,varargin{:});
Error in closeloop (line 182) ai = feval(fcn,'apply',ai,settings);
Can you help look into this question when you get a chance? Thanks so much in advance!
Jun

Sign in to comment.

More Answers (0)

Categories

Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!