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;

 채택된 답변

Greg Heath
Greg Heath 2014년 12월 25일

1 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

질문:

2014년 12월 24일

답변:

2014년 12월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by