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!