lmfit/lmfit-py — pull request #81 by Torrinos (2014-01-04 22:46:10+00:00)
Title: Added missing attributes to other fit methods

Greetings!

I started using LMFIT for my own project, where I switch between different fitting methods often and compare goodness of fit using reduced chisquared and Rsquared. I have discovered that all methods except least squares don't have defined redchi and residuals attributes. It was even pointed out on stackoverflow: http://stackoverflow.com/questions/17465701/attribute-error-from-minimizer-object-returned-from-scipy-optimize-minimize-fu

Hence the following changes were made to lbfgsb(), fmin() and scalar_minimize():
- Residual attribute added to the remaining methods. It is based on calling __residual() with optimized parameters
- Chisqr calculation is based on residuals
- Redchi added
- leastsq method is not changed

I tested this version with my project and haven't seen any issues. It also passed all available tests.
Please let me know if you have any questions or concerns.

Cheers