How can I get the training output vector (a2) from newrb?

Greetings, I am using newrb in predicting the drilling rate of penetration (ROP). I am comparing the results with a multiple regression, thus I am using an F-test. I need both the training output and the simulated output for the comparison. In newrb function, the training output is a2. How can I get the value of a2 and use it in my code.

2 Comments

Any chance you could provide a small example so we can reproduce it?
P = [1 2 3];
T = [2.0 4.1 5.9];
net = newrb(P,T);
P = 1.5;
Y = sim(net,P)
% This will give the trained output (Associated with p=1.5). I want the training data associated with 1, 2, and 3.

Sign in to comment.

 Accepted Answer

Apparently, there is a BUG in newrb. In previous versions
[ net tr ] = newrb(Xtrain,Ttrain);
would provide training history details in the structure tr in addition to providing the trained net.
Now, only the single output "net" is allowed and training history data is unavailable.
%CONSTANT MODEL TRAINING PERFORMANCE REFERENCE
[ O Ntrain ] = size(Ttrain)
Ytrain00 = repmat(mean(Ttrain,2),1,Ntrain));
MSEtrain00 = mse(Ttrain-Ytrain00)
%TRAINING:
MSEgoal = MSEtrain00/200 % R2train >= 0.995
net = newrb(Xtrain,Ytrain,MSEgoal)
Ytrain = net(Xtrain);
MSEtrain = mse(Ttrain-Ytrain)
R2train = 1- MSEtrain/MSEtrain00
%NONTRAINING SET OUTPUT
Ytest = net(Xtest);
%NONTRAINING SET PERFORMANCE IF TARGETS ARE KNOWN
MSEtest00 = repmat(mean(Ttest,2),1,Ntest)
MSEtest = mse(Ttest-Ytest)
R2test = 1- MSEtest/MSEtest00

More Answers (0)

Community Treasure Hunt

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

Start Hunting!