%  chi2=chi2(f,x,y,sigma)
function chi2=chi2(p,x,y,sigma)
chi2=norm((rawfunc(x,p)-y)./sigma,2)^2;
