Hello,
I am trying to generate an n-step ahead out of sample forecast for a NAR-ANN.
I used ntstool, Matlab GUI based interface for neural networks, to create a non-linear auto-regressive (NAR) model. I choose this model because I wanted to forecast a series based upon its own past values. Also, ANNs supposed to have better predictive accuracy than ARIMA models.
I imported data for my yt1 variable.
When I opened the ntstool, I choose NAR, i imported my data, I used the default training, testing and validation settings, i specifed 1 delay and 10 neurons.
My code in the script file was as follows. targetSeries = tonndata(yt,true,false); feedbackDelays = 1:1; hiddenLayerSize = 10; net = narnet(feedbackDelays,hiddenLayerSize); [inputs,inputStates,layerStates,targets] = preparets(net,{},{},targetSeries); net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; [net,tr] = train(net,inputs,targets,inputStates,layerStates); outputs = net(inputs,inputStates,layerStates); errors = gsubtract(targets,outputs); performance = perform(net,targets,outputs) view(net)
I am satisfied with my results, but I want to generate a 20 step ahead forecast. Does any one know how this is done for NAR-ANNs?
Best Answer