Scipy's Optimize Curve Fit Limits

后端 未结 4 1265
无人及你
无人及你 2021-01-06 04:07

Is there any way I can provide limits for the Scipy\'s Optimize Curve Fit?

My example:

    def optimized_formula(x, m_1, m_2, y_1, y_2, ratio_2):
            


        
4条回答
  •  伪装坚强ぢ
    2021-01-06 04:53

    Since curve_fit() uses a least squares approach, you might want to look at scipy.optimize.fmin_slsqp(), which allows do perform constrained optimizations. Check this tutorial on how to use it.

提交回复
热议问题