Scipy's Optimize Curve Fit Limits
问题 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): return (log(x[0]) * m_1 + m_2)*((1 - x[1]/max_age)*(1-ratio_2)) + ((log(x[1]) * y_1 + y_2)*(x[1]/max_age)*ratio_2) popt, pcov = optimize.curve_fit(optimized_formula, usage_and_age, prices) x[0] is age and max_age is a constant. With that in mind, as x[0] approaches maximum, x[1]/max_age approaches 1. Is it possible to provide a constraint/limit whereby x