How to avoid negative intermediate guess in nlmefit

6 views (last 30 days)
Rui
Rui on 17 Oct 2014
Commented: Rui on 22 Oct 2014
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

Accepted Answer

Tom Lane
Tom Lane on 18 Oct 2014
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 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!