Solving weighted least squares problem with linear constraints
이전 댓글 표시
I am trying to solve a weighted least squares problem with both linear inequality and linear equality constraints. Which Matlab function should I use?
채택된 답변
추가 답변 (1개)
John D'Errico
2015년 7월 2일
1 개 추천
No need to rewrite the problem into a form that quadprog can solve. Use lsqlin (optimization toolbox also). It does exactly what you wish.
댓글 수: 2
maagen
2015년 7월 2일
John D'Errico
2015년 7월 2일
Yes. Of course, if the weights are just a vector w, then diag(sqrt(w)) will suffice to build the multiplier. And if you have a big problem, then I would either make the W matrix a sparse one for faster multiplies, or I would use bsxfun to scale the rows of C. These are all minor issues unless you have a big problem or you are solving many such problems.
카테고리
도움말 센터 및 File Exchange에서 Linear Least Squares에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!