The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: How to display the actual and predicted value of training dataset in NARX
Replies: 6   Last Post: Feb 17, 2013 11:24 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Greg Heath

Posts: 6,312
Registered: 12/7/04
Re: How to display the actual and predicted value of training dataset in NARX
Posted: Feb 13, 2013 6:30 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Subject: How to display the actual and predicted value of training dataset in NARX
From: Arga Ridhalla
Date: 7 Feb, 2013 15:50:11
Message: 3 of 4
"Greg Heath" <> wrote in message
> "Arga Ridhalla" <> wrote in message
> > Hi all,
> > I'm a beginner in NN. I have dataset contain 8 time-series input variables and

1 time-series output variable (all of them are representing 60 timesteps). I want
MATLAB to display all the actual value and predicted value that the NN trained it
before. I also want MATLAB to display the future prediction of the output variable f
or 6 timesteps ahead. Please help me how to get that.
> >
> > Thanks for the help!

> Post your code so that we can help.
> Greg

Hi, Greg! Here's the code:
% S=load('nanas Dataset full');
% X=con2seq(S.S.nanasInputReducted);
% T=con2seq(S.S.nanasTargetCopy);
% % Create a Nonlinear Autoregressive Network with External Input
% inputDelays = 12;
% feedbackDelays = 12;

Why did you choose 12?
Did you look at the statistically significant lags of the autocorrelation of T
and crosscorrelation of X and T ?

% hiddenLayerSize = 10;
% net = narxnet(1:inputDelays,1:feedbackDelays,hiddenLayerSize);
% net.trainFcn='traingdm';
% net.trainParam.epochs=10000;

Delete the last 4 commands and accept the narxnet defaults.

% net.trainParam.max_fail=100;

Delete: This is ~ a factor of 20 too high if you are going to use a
validation set for validation stopping. Accept the default of 6.

% net.layers{1}.transferFcn ='logsig';

Delete. Accept the default of 'tansig' which is more appropriate for
hidden layers.

% % Prepare the Data for Training and Simulation
% [inputs,inputStates,layerStates,targets] = preparets(net,X,{},T);

whos X T inputs inputStates layerStates targets

This will confirm if you have the correct dimensions

% % Setup Division of Data for Training, Validation, Testing
% net.divideParam.trainRatio = 70/100;
% net.divideParam.valRatio = 15/100;
% net.divideParam.testRatio = 15/100;

Delete. These are defaults.

However, you are accepting the default DIVIDERAND which
will destroy the correlations you need. Use DIVIDEBLOCK instead.

% % Train the Network
% [net,tr] = train(net,inputs,targets,inputStates,layerStates);

Look at

tr =tr

and choose what you want for outputs.

Hope this helps.


P.S. I search the newsgroup once or twice a day using "neural".
However, your post was never listed. I was looking for something
I wrote previously and searched using "greg". Only then did your
post appear. Otherwise I would have replied much sooner....

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.