[ I N ] = size(x)
[ O N ] = size(t)
% Reference MSEs (From Naïve Constant Output Model y00 = mean(ttrn,2))
Ntrn = N-2*(0.15*N)
MSEtrn00 = mean(var(ttrn',1))
MSEtrn00a = mean(var(ttrn',0)
% Number of estimation degrees of freedom (See Wikipedia)
Ntrneq = Ntrn*O
Nw = (I+1)*H+(H+1)*O
Ndof = Ntrneq-Nw
etrn = ttrn-ytrn;
MSEtrn = sse(etrn)/Ntrneq
= mse(etrn)
MSEtrna = sse(etrn)/Ndof
= Ntrneq*MSEtrn/Ndof
% Normalized MSEs
NMSEtrn = MSEtrn/MSEtrn00
NMSEtrna = MSEtrna/MSEtrn00a
% Practical training goal
NMSEtrna <= 0.01
net.trainParam.goal = 0.01*Ndof*MSEtrn00a/Ntrneq
Hope this helps.
Thank you for formally accepting my answer
Greg
Best Answer