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

채택된 답변

Greg Heath
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개)

카테고리

Help CenterFile 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!

Translated by