It is possible to create a dynamic model using radial basis function in the matlab tool box?

3 views (last 30 days)
I want to create a net that uses radial basis function in a NARX model: inputs contain delays and feed back. Something like this http://fr.mathworks.com/help/nnet/ug/design-time-series-narx-feedback-neural-networks.html but using a radial basis function.

Accepted Answer

Greg Heath
Greg Heath on 23 Nov 2014
close all, clear all, clc, plt=0
[ X, T ] = simpleseries_dataset ;
net = narxnet(0:1,[],1);
net.layers{1}.transferFcn = 'radbas';
net.divideFcn = 'divideblock';
[Xs,Xi,Ai,Ts] = preparets(net,X,{},T);
xs = cell2mat(Xs);
ts = cell2mat(Ts);
plt = plt+1, figure(plt)
hold on
plot(xs(1,:),'LineWidth',2)
plot(ts,'r')
MSE00s = mean(var(ts,1))
net.trainParam.goal = 0.01*MSE00s;
Ntrials = 10
rng('default')
for i= 1:Ntrials
net = configure(net,Xs,Ts);
[ net tr Ys Es Xf Af] = train(net,Xs,Ts,Xi,Ai);
R2s(i) = 1-mse(Es)/MSE00s;
end
plt = plt+1, figure(plt)
hold on
plot(ts,'LineWidth',2)
plot(cell2mat(Ys),'r--')
R2s = R2s
% R2s = [ 0.99548 0.99556 0.99997 0.99813 0.99528 % 0.99528 0.99973 0.99534 0.9925 0.99085 ]
Hope this helps
Thank you for formally accepting my answer
Greg

More Answers (2)

Greg Heath
Greg Heath on 20 Nov 2014
Unfortunately, there are no options in the NNTBX that will yield this.
Either modify MATLAB functions or find non-MATLAB code.
  3 Comments
Edna Plazas García
Edna Plazas García on 12 Mar 2015
Hi Greg Heath
I've been looking at your code and it seems very good, but I have two question, the firts I have some data from a plant already taken, how do I call this code and serve this code with that data? attached a .mat with the data(are 2001 data), the first row is U and the second row is Y. the second is how do I validate data elsewhere in this simulation? as I use the function sim ?. Thanks you.

Sign in to comment.


Edna Plazas García
Edna Plazas García on 11 Mar 2015
Hi Greg Heath
I've been looking at your code and it seems very good, but I have a question, I have some data from a plant already taken, how do I call this code and serve this code with that data? attached a .txt with the data(are 2001 data), the first row is U and the second row is Y.
  1 Comment
Greg Heath
Greg Heath on 15 Mar 2015
Edited: Greg Heath on 15 Mar 2015
The attachment is missing. Either try again or email it to me *.txt or *.m.
U = input, Y = target ?
[ Ys Xf Af] = net(Xs,Ts,Xi,Ai);

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!