comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » MPFITFUN AND PARINFO
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: MPFITFUN [message #50945 is a reply to message #48702] Fri, 27 October 2006 11:20 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
nolan.smith1@gmail.com wrote:
> Hello,
>
> I have a little problem with mpfitfun.pro and I was wondering if anyone
> has any suggestions
> on how to solve it. I am using mpfitfun to perform a fit in a function
> that is the sum of 2 exponentials
> and a quadratic. The fit works very good but the result is giving me
> some negative values Y values
> which physically do not make sense (the numbers on Y are numbers per
> bin so they are positive).
> The negative values are only 3 (out of the 50 bins) and they never go
> lower than -1, so they do not go very low. Is there any way to limit
> the Y to be positive (like we do with the parameters?).

The simplest approach is simply to treat fitted values less than 0 as
if they were 0.

A more complicated approach would be to parameterize your model in such
a way that it's easy to impose non-negative results as a constraint on
model parameters. For instance, instead of using a*x^2+b*x+c for the
quadratic part of your model, use a*(x-b)^2+c, so that non-negativety
can be imposed by the requirements that "a GE 0 and c GE 0".
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: MPFITFUN
Next Topic: format control characters

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 11:23:34 PDT 2025

Total time taken to generate the page: 1.04769 seconds