It is my first time with neural network Kohonen.
Show older comments
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
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!