Problem with network obtain lagged values ​​NarX

1 view (last 30 days)
Very good, I think the graph as shown in the following link.
I summarize what I want to ask: The blue line is 51 closeloop and predictions on the red line are the actual values of the objectives in that period. The data used are outside the training sample, ie, whether for training / validation and test data use of1: 2000, for determining data used in closeloop 2000:2100 (this is an example to explain that I did not use data training sample). The problem is that the predicted outputs are delayed with respect to the original and I would get these outputs one time step earlier, but do not know how to do it because I used the Remove delay, but I have resolvido the problem. My code is mostly found in the following link:
Although I have made the appropriate changes and clarifications have changed, to give you an idea of the code that I developed while not exactly the text in the link. I'd like to specifically respondierais question I have at the beginning of the post as to what the code and I understand and I have made the appropriate changes. I'll put the code used to remove delay In case of emergency I made any error:
if true % code netc = closeloop(net);
netc.name = [net.name ' - Closed Loop'];
view(netc)
NumberOfPredictions = 50;
s=cell2mat(inputSeries);
t4=cell2mat(targetSeries);
a=s(1:8,2098:2100);
b=p2(1:8,1:50);
newInputSeries=[a b];
c=t4(1,2099:2100);
d=nan(1,51);
newTargetSet=[c d];
newInputSeries=tonndata(newInputSeries,true,false);
newTargetSet=tonndata(newTargetSet,true,false);
[xc,xic,aic,tc] = preparets(netc,newInputSeries,{},newTargetSet);
yPredicted = sim(netc,xc,xic,aic);
w=cell2mat(yPredicted);
nets = removedelay(net,1);
nets.name = [net.name ' - Predict One Step Ahead'];
view(nets)
entradas=newInputSeries;
quitarretraso=[c yPredicted];
quitarretraso=tonndata(quitarretraso,true,false);
[xs,xis,ais,ts] = preparets(nets,entradas,{},objetivos);
ys = nets(xs,xis,ais);
w1=cell2mat(ys);
end Mainly I'd like to be comentaraís to this delay in the graph and how I can fix it. The accuracies, but do not put the code of them have already been evaluated and I have no doubts.
I tried in several ways but no way to get ahead exits from actual. thank you very much.

Accepted Answer

Greg Heath
Greg Heath on 23 Mar 2013
Edited: Greg Heath on 23 Mar 2013
Please run your code on a nndataset so we can compare.
  3 Comments
Greg Heath
Greg Heath on 26 Mar 2013
I don't understand your reply. You can find the nn datasets @
help nndatasets
Choose one and we can compare results from your code.
Greg

Sign in to comment.

More Answers (0)

Categories

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

Tags

Community Treasure Hunt

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

Start Hunting!