Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Greg Heath Posts: 6,387 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

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" <heath@alumni.brown.edu> wrote in message
<kf06f4\$bd7\$1@newscl01ah.mathworks.com>...
> "Arga Ridhalla" <arga.ridhalla@yahoo.co.id> wrote in message
<ker31p\$85u\$1@newscl01ah.mathworks.com>...
> > 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
> >
> > Thanks for the help!

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

Hi, Greg! Here's the code:
%
% 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;
% net.trainParam.lr=1;
% net.trainParam.mc=1

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.

Greg

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....
Sorry

Date Subject Author
2/7/13 Greg Heath
2/13/13 Greg Heath
2/16/13 Greg Heath
2/17/13 Greg Heath