How can I solve a problem using Constrained Nonlinear Regression?

조회 수: 2 (최근 30일)
Melanie VT
Melanie VT 2020년 12월 14일
댓글: Melanie VT 2020년 12월 20일
Hi there,
I would like to perform contrained nonlinear regression. The scenerios for constraints are:
  1. Sum of parameters = n1 and each parameter < n2 (i.e. b1 + b2 + b3 = 2 and b1, b2, b3 < 1)
  2. Sum of parameters = n1 and each parameter ≤ n2 (i.e. b1 + b2 + b3 = 2 and b1, b2, b3 ≤ 1)
  3. Sum of parameters = n1 and n2 < each parameter < n3 (i.e. b1 + b2 + b3 = 2 and 0.5 < b1, b2, b3 < 1.5)
  4. Sum of parameters = n1 and n2 ≤ each parameter ≤ n3 (i.e. b1 + b2 + b3 = 2 and 0.5 ≤ b1, b2, b3 ≤ 1.5)
  5. Sum of parameters <, ≤, >, ≥ n1 or n1 <, ≤ sum of parameters <, ≤ n2 (i.e. b1 + b2 + b3 <, ≤, >, ≥ 2 or 0.5 <, ≤ b1 + b2 + b3 <, ≤ 1.5)
  6. Or any other alternative, if there is any remaining :)
I know that Matlab provides lsqlin for constrained linear LSQ and lsqnonline for nonlinear case. Yet, I couldn't find how to introduce summation contraint into lsqnonlin, like Aeq and beq in lsqlin.
I would be more than happy, if someone can help.
Cheers,
M
  댓글 수: 1
Bruno Luong
Bruno Luong 2020년 12월 14일
No optimizer can handles strict inequalities such as < and >. Simply because it is "ill posed" minimization.
Just think about this simple example:
What is is minimum of x with the constraint x > 0?
Such probem has solution.

댓글을 달려면 로그인하십시오.

채택된 답변

John D'Errico
John D'Errico 2020년 12월 14일
편집: John D'Errico 2020년 12월 14일
Sorry. lsqnonlin cannot handle general equalty or inequality constraints. Only bound constraints, and while you do have bound constraints, you also have an equality constraint on the sum.
That means you will need to use a more general optimizer, probably FMINCON. It can handle any of the constraint classes you mention.
Just pass it the sum of squares of residuals that you compute as an objective.
  댓글 수: 4
Alan Weiss
Alan Weiss 2020년 12월 18일
Alan Weiss
MATLAB mathematical toolbox documentation
Melanie VT
Melanie VT 2020년 12월 20일
I made a misinterpretation beforehand. Problem solved. Thank you both. Really grateful...

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by