def curve_fit_unscaled(*args, **kwargs):
<EOL>verbose = kwargs.pop('<STR_LIT>', False)<EOL>popt, pcov = _spopt.curve_fit(*args, **kwargs)<EOL>func = args[<NUM_LIT:0>]<EOL>x    = args[<NUM_LIT:1>]<EOL>y    = args[<NUM_LIT:2>]<EOL>ddof = len(popt)<EOL>try:<EOL><INDENT>sigma = kwargs['<STR_LIT>']<EOL>if sigma is None:<EOL><INDENT>sigma = _np.ones(len(y))<EOL><DEDENT>y_expect = func(x, *popt)<EOL>chisq_red = _chisquare(y, y_expect, sigma, ddof, verbose=verbose)<EOL>pcov = pcov / chisq_red<EOL>return popt, pcov, chisq_red<EOL><DEDENT>except ValueError:<EOL><INDENT>print('<STR_LIT:hello>')<EOL><DEDENT>
Use the reduced chi square to unscale :mod:`scipy`'s scaled :func:`scipy.optimize.curve_fit`. *\*args* and *\*\*kwargs* are passed through to :func:`scipy.optimize.curve_fit`. The tuple *popt, pcov, chisq_red* is returned, where *popt* is the optimal values for the parameters, *pcov* is the estimated covariance of *popt*, and *chisq_red* is the reduced chi square. See http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.optimize.curve_fit.html.