MIMO narxnet for future predictions. HOW!!

Here is my problem, I have a code that is running but I'm not sure that I do understand the concept because the results don't look like what I'm expecting. Here is my code:
x = [cost(1:24,:);Tamb24(1:24,:);SOC_old24(1:3,:);P_old24(1:3,:)];
xx = cell(1,nn);
PP = cell(1,nn);
for i = 1:nn
xx{i} = x(:,i);
PP{i} = P24(1:24,i);
end
net = narxnet(1:2,1:2,5);
[Xs,Xi,Ai,Ts] = preparets(net,xx,{},PP);
net = train(net,Xs,Ts,Xi,Ai);
[Y,Xf,Af] = net(Xs,Xi,Ai);
perf = perform(net,Ts,Y);
[netc,Xic,Aic]= closeloop(net,Xf,Af);
xnew = [cost(1:24,:);Tamb24(1:24,:);SOC_old24(1:3,:);P_old24(1:3,:)];
n = 100;
xxnew = cell(1,n);
for i = 1:n
xxnew{i} = xnew(:,i);
end
y2 = netc(xxnew,Xic,Aic);
yy = cell2mat(y2);
figure(2)
plot(1:24,P24(1:24,4))
hold on
grid on
plot(1:24,yy(:,4))
legend('Measured','Model')
hold off
Sometimes I run this code and get really very good R values and the parity plot looks nice, but the plot of the predicted data vs. the actual one is really terrible! Is there something wrong with my understanding of how this should work?

Answers (1)

And by the way, I have already tried a lot of variations in the input delay, feedback delay, and the number of nodes.

1 Comment

PLEASE MOVE YOUR COMMENT TO A COMMENT BOX. THEN DELETE IT FROM THE ANSWER BOX
THANKS

Sign in to comment.

Asked:

on 30 Apr 2018

Commented:

on 1 May 2018

Community Treasure Hunt

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

Start Hunting!