How can i improve the performance of a closed loop NARX?

Hello, I’m trying to create Narx To use it instead of Equation (T(j,i)=T(j,i-1)+0.001*(T(j,i)-T_outdoor(i)), where the output and input of the equation is visible in the mydataTemprature file, the equation includes the outdoor temperature at time (i) and the internal temperature at time (i-1) as the input and internal temperature at Time step (i) as output.
first,i create narx in ''open'' form and achieved to performance 0.0480 but when used this results(Xi,Ai) at ''closed loop'' form then predict, the performance be 291.0290.
In addition to the above problem is another question that,Is it correct to use X1=num2cell(T(6,1:96*50)) as XTrain and consider a input delays=0, or to use X=num2cell(T(6,2:96*50+1)) as XTrain and consider input delays=1?
Can anyone help solve these problems?
The data used is attached
load mydataTemprature
X1=num2cell(T(6,1:96*50));
X=num2cell(T(6,2:96*50+1));
T =num2cell(T(3,1:96*50));
numTimeStepsTrain = floor(0.9*numel(T(1,1:96*50)));
XTrain = X(1:numTimeStepsTrain);%90 train data
TTrain = T(1:numTimeStepsTrain);
XPredict =X(numTimeStepsTrain+1:end);
Yreal=T(numTimeStepsTrain+1:end);
trainFcn = 'trainbr';
net = narxnet(1,1,10,'open',trainFcn);
[Xs,Xi,Ai,Ts] = preparets(net,XTrain,{},TTrain);
net.trainParam. max_fail=40;
net.trainParam. epochs=100;
net.trainParam.min_grad=1e-7;
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 5/100;
[net,tr] = train(net,Xs,Ts,Xi,Ai);
[Y,Xf,Af] = net(Xs,Xi,Ai);
e = gsubtract(Ts,Y);
performance = perform(net,Ts,Y)
[netc,Xic,Aic] = closeloop(net,Xf,Af);
Yc = netc(XPredict,Xic,Aic);
performance = perform(net,XPredict,Yc)

Answers (1)

I found that the performance index of a closed loop Narx is not convex.
So I found great improvements by randomly perturbing parameters in the previous optimal solution and repeating the optimization several times. Any time preserving the parameters of the previous optimal solutionn
Giuseppe

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Release

R2021b

Asked:

on 13 Feb 2022

Answered:

on 13 Jun 2022

Community Treasure Hunt

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

Start Hunting!