%
%  f=fun(p)
%
function f=fun(p)
global X;
global Y;
global SIGMA;
f=zeros(length(Y),1);
f=(rawfunc(X,p)-Y)./SIGMA;
