How to avoid negative intermediate guess in nlmefit

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

 Respuesta aceptada

Tom Lane
Tom Lane el 18 de Oct. de 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 comentarios

Rui
Rui el 18 de Oct. de 2014
Hi Tom,
Thanks! I saw there's an option "ParamTransform", should I use this option, or should I explicitly take logP? Are these two equivalent?
If I estimate logP and use exp(logP) in my model, would that affect the estimation of covariance matrix? I mean should I somehow covert it back to normal space using exp()?
Rui
Tom Lane
Tom Lane el 19 de Oct. de 2014
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 el 22 de Oct. de 2014
Thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

Rui
el 17 de Oct. de 2014

Comentada:

Rui
el 22 de Oct. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by