Forecast with GRNN

Hello,
I would like to make a multi step ahead prediction with GRNN network. My idea is: I make a one step ahead prediction and with a for loop I train the network again with the earlier predicted data. So I get a multi step forecast. I made the code, but the prediction is always a horizontal line! I do not know what is the problem!
Here is my code:
%--------------Paraméterek------------------
adatSzam = 500;
N = 20;
%--------------Adatok betöltése, előkészítése--------------
load('C:\Neuroforex\Adatok\HMA35nnagy.mat');
imputSeries1 = HMA35nnagy(1:adatSzam)';
for i=1:N
X = [1:length(imputSeries1)]
T = imputSeries1;
%--------------GRNN előállítása------------------
spread = 0.1;
net = newgrnn(X,T,spread);
view(net);
trainOutput = net(X);
%-------------Becslés beállítása----------------
predictSeries = [length(imputSeries1)+1];
yPred = net(predictSeries);
%-----------------Plot 1 lefutásra-------------------------
hold on;
%Bemeneti adatok plottolása
plot(X,T,'k','markersize',2,'color','black')
outputline = plot(X,trainOutput,'o','markersize',2,'color','blue');
%Becslés plottolása
%plot(predictSeries,[yPred(1:end-1),nan(1,1)],'linewidth',1,'color','red')
predict = plot(predictSeries,[nan(1,length(predictSeries-1)),yPred],'o','markersize',2,'color','green');
%plot([nan(1,length(imputSeries1)),yPred(end:end)],'linewidth',1,'color','green');
title('Becslés eredménye')
xlabel('Gyertyaszám')
ylabel('Keresztárfolyam')
%-----------Jelenlegi becslés hozzáadása a bemeneti adatokhoz--------
imputSeries1 = [imputSeries1, yPred(end:end)];
end
Picture of the predict:
Thanks Adam

 采纳的回答

Greg Heath
Greg Heath 2011-11-29

0 个投票

Newgrnn is not appropriate for timeseries prediction.
Use newfftd.
help newfftd
doc newfftd
Search the archives
newfftd
heath newfftd
Hope this helps.
Greg

1 个评论

Hi Greg,
I have already made a NARX network, but my forecasted results weren't good enough. Thats's why I started to search for other solutions. I found an article with GRNN prediction:
http://www.neural-forecasting-competition.com/downloads/NN3/methods/44-NN3_WeizhongYan.pdf
I already tried to define delays in grnn.m file. So my question is: Is there any way to predict with GRNN?
Thanks Adam

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by