How neural network in Matlab gives such a nice prediction while having just one input neuron?

656 Views Asked by At

Here is the script generated by ntstool. I removed commentaries and set feedbackDelays(number of input neurons) and hiddenLayerSize to be 1. Target time-series is solar_dataset(comes with Matlab). Other parameters are default.

T = solar_dataset;
trainFcn = 'trainlm';

feedbackDelays = 1;
hiddenLayerSize = 1;
net = narnet(feedbackDelays,hiddenLayerSize,'open',trainFcn);

[x,xi,ai,t] = preparets(net,{},{},T);

net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;

[net,tr] = train(net,x,t,xi,ai);

y = net(x,xi,ai);
e = gsubtract(t,y);

view(net)

netc = closeloop(net);
[xc,xic,aic,tc] = preparets(netc,{},{},T);
yc = netc(xc,xic,aic);

nets = removedelay(net);
[xs,xis,ais,ts] = preparets(nets,{},{},T);
ys = nets(xs,xis,ais);

Run it and see the result. On my computer after 10-15 iterations traning stops with pretty good results: Time-Series Response chart looks nice and the other charts too. enter image description here

Is it possible for a net with one input neuron to predict anything at all? Or do I interpret the results wrong or maybe my understanding of feedbackDelays parameter is wrong?