[SciPy-user] chi square value on leastsq

Robert Kern rkern at ucsd.edu
Tue Jun 28 20:23:41 CDT 2005

Fernando Avila Castro wrote:
>     Hi, i'm using leastsq to fit a set of data and it works quite well. 
> However, i would like to get the chi square value of this fit, or at 
> least any indication of how good the fit was.

x, mesg = optimize.leastsq(f, x0, ...)

chi2 = sum(power(f(x), 2))

Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter

More information about the SciPy-user mailing list