Plz, Edit the NEWFF according to the latest version of MATLAB.

when i simulate the below code it is showing some errors.
like obsolete way of using NEWFF.
what is the new model for it ?
Can some one edit the NEWFF according to the latest version.
  1. load data.txt
  2. P = data(1:15,1);
  3. T = data(16:30,1);
  4. a = data(31:45,1);
  5. s = data(46:60,1);
  6. [py, pys] = mapminmax(P');
  7. [ay, ays] = mapminmax(a');
  8. [ty, tys] = mapminmax(T');
  9. [sy, sys] = mapminmax(s');
  10. net = newff(minmax(py),[6 1], {'logsig','logsig'}, 'triangdm')
  11. net.trainParam.epochs = 3000;
  12. net.trainParam.lr = 0.5;
  13. net.trainParm.mc = 0.8;
  14. net = train(net,py,ty);
  15. y = sim(net,ay);

6 Comments

0. help newff
doc newff
type newff
1. Do you think it is inconsiderate of you to not include one of the MATLAB data sets for us to use as an example?
>> help nndatasets
2. Do you think it is inconsiderate of you to not include your error messages"
3. Why not use the defaults as in the help newff example?
4. Why not use the transpose in statements 2-5?
5. traingdm is misspelled
6. net.trainParam is misspelled
7. mapminmax is a default
8. {'tansig' 'tansig' } is the natural combination to use with the mapminmax transformations to [ -1, 1 ]
net = newff(P,T, 6 ,{'tansig' 'tansig'},'traingdm')
9. The defaults settings for 'traingdm' are
net.trainParam.epochs = 1000
net.trainParam.lr = 0.01
net.trainParam.mc = 0.9
5662.421 5662.190 5662.003 5662.153 5662.198 5662.104 5662.099 5662.089 5662.015 5662.013 5662.002 5662.084 5662.197 5662.167 5662.137 5662.157 5662.198 5662.188 5662.198 5662.297 5662.177 5662.196 5662.195 5662.186 5662.176 5662.156 5662.196 5662.196 5662.194 5662.195 5662.195 5662.199 5662.208 5662.223 5662.241 5662.261 5662.286 5662.317 5662.345 5662.378 5662.417 5662.455 5662.497 5662.537 5662.579 5662.622 5662.666 5662.198 5662.893 5662.798 5662.897 5662.197 5662.197 5662.197 5662.197 5662.197 5662.198 5662.198 5662.198 5662.977 5662.997 5662.956 5662.905 5662.196 5662.196 5662.196 5662.196 5662.196 5662.194 5662.195 5662.195 5662.199 5662.208 5662.223 5662.241 5662.261 5662.286 5662.317 5662.345 5662.378 5662.417 5662.455 5662.497 5662.537 5662.579 5662.622 5662.666 5662.195 5662.199 5662.208 5662.223 5662.241 5662.261 5662.286 5662.317 5662.991 5662.622 5662.666 5662.195 5662.199 5662.198 5662.197 5662.197 5662.197 5662.345 5662.378 5662.417 5662.455 5662.497 5663.913 5663.821 5663.838 5663.957 5663.845 5663.838 5663.835 5663.817 5663.910 5663.913 5663.917 5662.992 5663.822 5663.808 5663.720 5663.789 5663.833 5663.840 5663.821 5663.821 5663.813 5663.801 5663.801 5663.804 5662.198 5662.197 5662.197 5662.197 5662.345 5662.378 5662.417 5662.455 5662.497 5662.800 5662.804 5662.791 5662.788 5662.799 5662.794 5662.786 5662.804 5662.805 5662.798 5661.753 5662.808 5662.198 5662.197 5662.197 5662.197 5662.345 5662.378 5662.417 5662.455 5662.497 5662.800 5662.804 5662.791 5662.788 5662.799 5662.794 5662.786 5662.804 5662.805 5662.798 5661.753 5662.808 5662.811 5662.796 5662.800 5662.198 5662.197 5662.197 5662.197 5662.345 5662.378 5662.417 5662.455 5662.497 5662.978 5662.974 5662.870 5662.967 5662.967 5662.963 5662.959 5662.942 5662.455 5662.497 5662.995 5662.990 5662.198 5662.198
here is data present inside the data.txt file collected from NOAA site.
How many hidden nodes did you need to get a satisfactory answer?
let me explain it clearly.
The data shown above is water column height. Most of the time it is 5661/5662.xxx, but some times it will be 5663 or more than it. i am simulating it to detect the 5663.
net = newff(minmax(py),[6 1], {'logsig','logsig'}, 'triangdm')
in the above statement -1 & 1 are the inputs to the net with 1 output and 3 input nodes.
This is not working with R2012a.
i want this program to work with R2012a.
Thanks
@#?!
1. That is not a clear explanation AND it seems to have little to do with your original post.
2. Why are you posting an equation that
a. is obsolete
b. has inappropriate transfer functions
c. has a misspelled training function (to which you were alerted earlier)
3. If you have 2012a, why are you trying to use the obsolete newff?
4. Now it seems that you might want the simple classifier
output = hardlim(input-5663)
4. Please clarify.
a. Single output y(t) = ( 566x.xx or 0/1?)
b. Corresponding input y( t-d:t-1)
I got it from old records. i want to re-build it, so i edited few commands with my knowledge. i'm not able to do it further.
4.
a. Single output y(t) = ( 566x.xx or 0/1?) it is in the range of -1 to 1(includes both boundaries).

Sign in to comment.

 Accepted Answer

This is a Time-Series Problem that can be solved using NARNET with a feedback delay of 15.
help NARNET
doc NARNET
Search NARNET in the NEWSGROUP and ANSWERS
Thank you for formally accepting my answer
Greg

More Answers (1)

if true
% code
end
clear all, clc
[ inputs, targets ] = simplefit_dataset;
P = inputs(1:2:end);
T = targets(1:2:end);
[ I N ] = size(P)
[ O N ] = size(T)
MSE00 = var(T,1) % 8.3328 Reference MSE
Neq = N*O % No. of equations = prod(size(T)
a = inputs(2:2:end);
s = targets(2:2:end);
% Nw = (I+1)*H+(H+1)*O % No. of weights = Nw
{Hub = -1+ceil( (Neq-O)/(I+O+1)) % 15 (Neq >= Nw)
Hmin = 0
dH = 2
Hmax =ceil(Hub/2)
Ntrials = 10
MSEgoal = MSE00/100
MinGrad = MSEgoal/10
rng(0)
j = 0
for h = Hmin:dH:Hmax
j=j+1
if h ==0
net = newff(P,T, []);
else
net=newff(P,T,h);
end
for i = 1:Ntrials
hidden = h
ntrials = i
net.trainParam.goal = MSEgoal;
net.trainParam.min_grad = MinGrad;
[ net tr Y E ]= train(net,P,T);
NMSE(i,j) = mse(E)/MSE00;
end
end
NMSEtst = mse(s-net(a))/var(s,1) %4.0567e-005
H = Hmin:dH:Hmax
NMSE=NMSE

2 Comments

I didn't get it.
Can you explain.
Thanks
@#?!
Sorry I missed your comment. If you have any SPECIFIC questions on the code,
please post.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!