how to define the size of feedback delays and number of hidden layer in narnet ?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello
I am using NN to predict a single time series. My code is
targetSeries = tonndata(T,false,false);
% Create a Nonlinear Autoregressive Network
feedbackDelays = 1:20;
hiddenLayerSize = 5;
net = narnet(feedbackDelays,hiddenLayerSize);
% Prepare the Data for Training and Simulation
[inputs,inputStates,layerStates,targets] = preparets(net,{},{},targetSeries);
% Setup Division of Data for Training, Validation, Testing
% For a list of all data division functions type: help nndivide
net.divideFcn = 'divideblock'; % Divide data block
net.divideMode = 'time'; % Divide up every value
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,inputs,targets,inputStates,layerStates);
netc = closeloop(net);
N=240; % multistep ahead
NetworkInput=targetSeries;
for i=1:N;
[xc,xic,aic,tc]=preparets(netc,{},{},NetworkInput);
yc=netc(xc,xic,aic);
NetworkInput(1,end+1)=yc(1,end);
end
My time series is a quasi-periodic signal with a main peaks near 115 time units (with a slower modulation of the successive peaks). My idea is to perform cross-validation to test the impacts of feedbackDelays and hiddenlayerSize, but are they objective methods to define these parameters ? Another question : is it possible to use narnet to forecast a non-linear trend ?
Thank you in advance
Vincent
0 件のコメント
採用された回答
Greg Heath
2014 年 4 月 14 日
Estimate the significant autocorrelation lags using nncorr or fft.
Estimate the number of hidden nodes by trial and error.
Search using
greg nncorr narnet Ntrials
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Sequence and Numeric Feature Data Workflows についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!