how to forecast with nonlinear autoregressive neural networks

조회 수: 7 (최근 30일)
Don Charles
Don Charles 2014년 10월 19일
답변: Testing zone 2017년 10월 21일
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?

채택된 답변

Greg Heath
Greg Heath 2014년 10월 22일
편집: Greg Heath 2015년 6월 23일
This is a highly auto-correlated series. You can get good results with with 1 delay and NO hidden layer :
net = narNET(1,[]);
The significant autocorrelation lags are so numerous you don't even need a time series. I was able to get an Rsquare of 0.925 for predicting 20 lags ahead with fitnet(3).
If you want to use a feedback timeseries you should be able to get equivalent results with
net = narnet(20,3);
Hope this helps.
Thank you for formally accepting my answer
Greg
  댓글 수: 2
Don Charles
Don Charles 2014년 10월 22일
Thanks for your feed back Greg Health. What about the 20-step ahead forcast? I see the command fitnet is used to fit the neural network. eg fitnet(hiddenSizes,trainFcn). But what is the code to do an n(20)-step ahead forecast with the NAR.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Testing zone
Testing zone 2017년 10월 21일
Hello Matlab mates, I want to create a project in MATLAB that can detect
  1. No of faces in real-time through webcam or CCTV
  2. save the values in the database how many customers came to shop or brand today
  3. and then I want to apply some Artifical intelligence to predict and forecast how many customers come in next day.
but I don't know how to implement the prediction or forecasting code in Matlab

카테고리

Help CenterFile Exchange에서 Signal Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by