# am i using the results of the neural network fitting tool correctly?

2 views (last 30 days)
Scott DeWolf on 5 Aug 2012
hello,
i'm relatively new to nn and am not sure if nftool is the right tool to use for this problem.
i have three time series that are are the inputs to a nonlinear system. in a perfect world, the output of this nonlinear system would be a constant time series. here is my attempt to use a neural network to model this nonlinear system (a representative example with noise):
x=linspace(0,199,200);
inputs(1,:)=exp(-x/100)+exp(-x/10)+randn(1,200)/20; % exponential function
inputs(2,:)=exp(-((x-199)/100).^2)+randn(1,200)/50; % Gaussian function
inputs(3,:)=sin(x/2)+randn(1,200)/10; % sinusoid
target=median(inputs(1,:))*ones(1,200)+randn(1,200)/1000; % constant
net=fitnet(10);
net.inputs{1}.processFcns={'removeconstantrows','mapminmax'};
net.outputs{2}.processFcns={'removeconstantrows','mapminmax'};
net.divideFcn='dividerand';
net.divideMode='sample';
net.divideParam.trainRatio=70/100;
net.divideParam.valRatio=15/100;
net.divideParam.testRatio=15/100;
net.trainFcn='trainlm';
net.performFcn='mse';
[net,tr]=train(net,inputs,target);
output=net(inputs);
the output of this appears to yield a time series similar to the target series within its abilities to make a constant out of the three input time series.
my question comes when i use this trained network on a similar set of inputs, for example if i add a constant to the first input:
inputs(1,:)=inputs(1,:)+10;
output=net(inputs);
i (naively) expected that i would get the same output as before, just shifted by 10 (i.e. what i just added to the first input), however, i get something else altogether.
am i doing something wrong, and/or is there a better way to use neural networks for nonlinear, multidimensional transfer function estimation?
thanks!

Greg Heath on 8 Aug 2012
The neural network is just a model that characterizes the I/O mapping of the design (train+val) data. If nondesign data doesn't have, approximately, the same summary stats, then don't expect good reslts.
Hope this helps.
Greg