How to avoid negative intermediate guess in nlmefit

조회 수: 2 (최근 30일)
Rui
Rui 2014년 10월 17일
댓글: Rui 2014년 10월 22일
Hello everyone,
when I use nlmefit, it always comes up with some negative guess after a few iterations, these negative values crash my ODE solver. Is there a way to avoid this?
The easiest way I can think of is to set lower bound for fitted parameters, however, I cannot figure out how to do that with nlmefit.
Thank you!
Rui

채택된 답변

Tom Lane
Tom Lane 2014년 10월 18일
If a parameter P needs to be positive, sometimes people will instead estimate a parameter logP and then use exp(logP) in place of P in their function.
  댓글 수: 3
Tom Lane
Tom Lane 2014년 10월 19일
I'd forgotten about this parameter. Yes, I'd use that to specify a log transform and let the function take care of converting the covb matrix.
Rui
Rui 2014년 10월 22일
Thank you!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver-Based Nonlinear Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by