Need help NARX Neural Network forecasting methodology. 1,6,12 hours / step ahead ???

I read a lots of post in NARX topics/solutions, I'm very novice in this NN architecture/algorithm. I'm not sure what am I doing now is correct or not
This is what I'm going to do I want to use ANN with Back Propagation Multilayer perceptron model to predict rainfall rate. First I need to predict whether it is raining or not raining, then followed by the 1,6,12 hour look ahead prediction.
-Input data would be humidity, wind speed, pressure, temperature , dew point 
-target is the rainfall rate 
I have a data that in one hour interval for each input variable.
My questions are: 1- What is the input delay and feedback delay ( is it , if I want to forecast the next 6 hours , should I just set the input delay 1:6 ??? and 1:12 for the next 12 hours? 2- OR should I just create each dataset for each forecast time (t+n) ???
Here is my code
Input_Parameter = tonndata(ANN_num_TEST(:,[1:5]),false,false);
Target_Parameter = tonndata(ANN_num_TEST(:,6),false,false);
trainFcn = 'trainbr'; % Bayesian Regularization
% trainFcn = 'trainlm';
% trainFcn = 'trainrp';
% Create a Nonlinear Autoregressive Network with External Input
inputDelays = 1:1;
feedbackDelays = 1:1;
hiddenLayerSize = 10;
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSize,'open',trainFcn);
% Prepare the Data for Training and Simulation
[Input_Net,Input_Net_initial,Layer_Delay_initial,Target_Net] = preparets(net,Input_Parameter,{},Target_Parameter);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 80/100;
net.divideParam.valRatio = 10/100;
net.divideParam.testRatio = 10/100;
% net.trainParam.max_fail = 50;
net.trainParam.min_grad=1e-10;
net.trainParam.show=10;
net.trainParam.lr=0.01;
net.trainParam.epochs=1000;
net.trainParam.goal=0.01;
% Train the Network
[net,tr] = train(net,Input_Net,Target_Net,Input_Net_initial,Layer_Delay_initial);
% Test the Network
% y = net(x,xi,ai);
Prediction_Result = net(Input_Net,Input_Net_initial,Layer_Delay_initial);
e = gsubtract(Target_Net,Prediction_Result);
performance = perform(net,Target_Net,Prediction_Result);
% View the Network
% view(net)
% variable for plot actual vs prediction
Prediction = (cell2mat(Prediction_Result))';
Cluster = (cell2mat(Target_Net))';
3- Is the forecast for t+1 ? Should I use multistep ahead NARX ???
Thank you
This is the result for 1 step ahead , why it is shifting?

1 件のコメント

Saeed Bello
Saeed Bello 2021 年 3 月 30 日
I have similar question asked above.
Does anyone have answer to this question?
Thank you in advance.

サインインしてコメントする。

 採用された回答

Greg Heath
Greg Heath 2016 年 1 月 24 日
編集済み: Greg Heath 2016 年 1 月 24 日
Choose the number of lags from the number of significant lags in the input/target crosscorrelation function and the target autocorrelation function.
I have zillions of examples in both the NEWSGROUP and ANSWERS just search on
greg nncorr
Hope this helps.
Thank you for formally accepting my answer
Greg

1 件のコメント

Noor Mohd Safar
Noor Mohd Safar 2016 年 1 月 24 日
Thank you Greg, I read your post in NEWSGROUP - now I'm working on Multistep via divideblock

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by