It is my first time with neural network Kohonen.

I try predict time series price copper with neural network Kohonen. In file testsom.m is erroron wzor=[wzor,predc]( The following error occurred converting from double to struct: Error using struct Conversion to struct from double is not posiible.
function result=testsom(szereg,pocz,p,ile)
%p = 10; %pocz = 1140; kon = pocz+p*ile; wy = []; good = []; bladd = 0; bladg = 0; cp = 8;
sp = 10; sk = 5;
rozxx = 5; rozxy = 5; rozxy = 5; rozyy = 5; wylicz = szereg(1:pocz);
for ii=pocz:p:(kon-p)
wzor = szereg(1:ii);
model = start(wzor,sk,sp,rozxx,rozxy,rozxy,rozyy);
od = ii;
do = ii + p;
for i=od:do-1
w = odp(model,wzor(i-sp+1:i-1),1,wzor(i-1)); % predykcja wartosci szereg(i)
predc = w; % nowa wyliczona wartosc szeregu czasowego
wzor = [wzor , predc];
wylicz = [wylicz, predc];
end
end
% liczenie bledu
srednia = mean(szereg(1:kon)); for i=pocz:kon bladg =bladg + abs(wylicz(i) - szereg(i)); bladd = bladd + abs(szereg(i)- srednia); end
blad = bladg/bladd;
plot(wylicz,'r'); hold on; plot(szereg);
result = blad;

 Accepted Answer

Kohonen is not appropriate for time series prediction.
If you have input and target series
help narxnet
doc narxnet
If you only have one series
help narnet
doc narnet
You can practice on MATLAB data
help nndatasets
doc nndatasets
You can search the NEWSGROUP and ANSWERS for some of my examples
greg narxnet
or
greg narnet
Hope this helps.
Thank you for formally accepting my answer
Greg

More Answers (0)

Categories

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

Asked:

on 24 Dec 2014

Answered:

on 25 Dec 2014

Community Treasure Hunt

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

Start Hunting!