[SciPy-user] chi square value on leastsq

Robert Kern rkern at ucsd.edu
Wed Jun 29 13:35:24 CDT 2005

Fernando Avila Castro wrote:

>  >>p, plsq = leastsq(residuals, p0, args=(y_meas, x))
>  >>chi2 =sum(power(residuals,2))
> but it doesn't work.
> What I'm doing wrong?

chi2 = sum(power(residuals(p), 2))

You have to actually evaluate the function.

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