Constrained least-squares estimation in Python

浪尽此生 提交于 2019-12-01 03:32:57
denis

scipy-optimize-leastsq-with-bound-constraints on SO givesleastsq_bounds, which is leastsq with bound constraints such as 0 <= x_i <= 1. The constraint that they sum to 1 can be added in the same way.
(I've found leastsq_bounds / MINPACK to be good on synthetic test functions in 5d, 10d, 20d; how many variables do you have ?)

Have a look at this tutorial, it seems pretty clear.

Since MATLAB's lsqlin is a bounded linear least squares solver, you would want to check out scipy.optimize.lsq_linear.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!