title: How to obtain the chi squared value as an output of scipy.optimize.curve_fit?
body: <p>Is it possible to obtain the value of the chi squared as a direct output of <code>scipy.optimize.curve_fit()</code>?</p>
  
  <p>Usually, it is easy to compute it after the fit by squaring the difference between the model and the data, weighting by the uncertainties and summing all up. However, it is not as direct when the parameter <code>sigma</code> is passed a 2D matrix (the covariance matrix of the data) instead of a simple 1D array.</p>
  
  <p>Are really the best-fit parameters and its covariance matrix the only two outputs that can be extracted from <code>curve_fit()</code>?</p>