Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Prediction of future values using narnet
Posted:
Jan 24, 2014 4:22 AM


I have time series of hourly data during the period from 1980 to 2005 (219000 timesteps), and I need to predict those values for the period 20062012 (52560 timesteps). I have generated the code using NN Toolbox, but I need to make clear next issues: How can I get predicted values based on the created network for next 6 years? I know that closed loop is used for multistep prediction, but the elements of resulting array yc have constant values. Is that value prediction for timestep y(t+1)? How can I get predictions for additional 52559 timesteps?
I created the code by nn toolbox, and I used divideblock division since the time serie is considered.
The code:
if true % WSin  feedback time series. load('WSin.mat') targetSeries = WSin; feedbackDelays = 1:4; hiddenLayerSize = 10; net = narnet(feedbackDelays,hiddenLayerSize); net.inputs{1}.processFcns = {'removeconstantrows','mapminmax'}; [inputs,inputStates,layerStates,targets] = preparets(net,{},{},targetSeries); % Setup Division of Data for Training, Validation, Testing net.divideFcn = 'divideblock'; % Divide data in blocks net.divideMode = 'time'; % Divide up every value net.trainFcn = 'trainrp'; net.performFcn = 'mse'; % Mean squared error net.trainParam.epochs=2000; % Train the Network [net,tr] = train(net,inputs,targets,inputStates,layerStates); % Test the Network outputs = net(inputs,inputStates,layerStates); errors = gsubtract(targets,outputs); performance = perform(net,targets,outputs) % Recalculate Training, Validation and Test Performance trainTargets = gmultiply(targets,tr.trainMask); valTargets = gmultiply(targets,tr.valMask); testTargets = gmultiply(targets,tr.testMask); trainPerformance = perform(net,trainTargets,outputs) valPerformance = perform(net,valTargets,outputs) testPerformance = perform(net,testTargets,outputs) % View the Network view(net) % Closed Loop Network netc = closeloop(net); [xc,xic,aic,tc] = preparets(netc,{},{},targetSeries); yc = netc(xc,xic,aic); perfc = perform(net,tc,yc) end
Thank you very much in advance for helping me with this, I have tried to find an answer in earlier topics, but since I tried everything I read, I needed to ask you.
With kind regards



