Path: news.mathworks.com!not-for-mail
From: "Arga Ridhalla" <arga.ridhalla@yahoo.co.id>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to display the actual and predicted value of training dataset in NARX
Date: Thu, 7 Feb 2013 15:50:11 +0000 (UTC)
Organization: Institut Teknologi Bandung
Lines: 39
Message-ID: <kf0ifj$jd$1@newscl01ah.mathworks.com>
References: <ker31p$85u$1@newscl01ah.mathworks.com> <kf06f4$bd7$1@newscl01ah.mathworks.com>
Reply-To: "Arga Ridhalla" <arga.ridhalla@yahoo.co.id>
NNTP-Posting-Host: www-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1360252211 621 172.30.248.48 (7 Feb 2013 15:50:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 7 Feb 2013 15:50:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3719384
Xref: news.mathworks.com comp.soft-sys.matlab:788522

"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 for 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;
hiddenLayerSize = 10;
net = narxnet(1:inputDelays,1:feedbackDelays,hiddenLayerSize);
net.trainFcn='traingdm';
net.trainParam.epochs=10000;
net.trainParam.lr=1;
net.trainParam.mc=1;
net.trainParam.max_fail=100;
net.layers{1}.transferFcn ='logsig';

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

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

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

Thanks for the help.