I created a time delay neural network in MATLAB to forecast the coming day's value. My time series is very noisy, but there are repeating patterns, which could be useful for the network.
I compared the results of neural network with Autoregressive model and the prediction of AR(1) and AR(2) are extremly better. Is my script wrong? Is it over fitted?
input = ...; % Normalised data [0-1] T = tonndata(input,false,false); trainFcn = 'trainlm'; % Levenberg-Marquardt
% Create a Nonlinear Autoregressive Network
feedbackDelays = 1:2; hiddenLayerSize = 5; net = narnet(feedbackDelays,hiddenLayerSize,'open',trainFcn); net.trainParam.showWindow = false; net.performFcn = 'mse'; [x,xi,ai,t] = preparets(net,{},{},T); % Setup Division of Data for Training, Validation, Testing
net.divideFcn = 'divideind'; net.divideParam.trainInd = 1:270; net.divideParam.testInd = 271:280; net.divideParam.valInd = 281:300; for i = 1:50 % Train the Network
[net,tr] = train(net,x,t,xi,ai); nets = removedelay(net); [xs,xis,ais,ts] = preparets(nets,{},{},T); ys = nets(xs,xis,ais); ys_results(b,i) = ys(end); end
Best Answer