Re: MPFITFUN, constraining parameters [message #47427] |
Wed, 08 February 2006 08:56 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
luxx11@gmail.com writes:
> Hi,
> I'm using Craig Markwardt's MPFITFUN to fit a function with 6
> parameters. I need that the product of parameter 2 with parameter 4
> stays below 1 (P[2]*P[4]<1).
> How can I do this? I think that it's not possible with the TIED
> keyword.
Parameter constraints need to be constant (i.e. a constant upper
and/or lower bound).
Perhaps you can reparameterize your function so that the product you
are interested in is an explicit parameter. Then you can set an upper
bound of 1.
For example,
function myfunc, x, p
p2 = p(2) ;; Original p(2) value
p2p4 = p(4) ;; Product p(2)*p(4) value
p4 = p2p4 / p2 ;; Original p(4) value
...
end
This might run into trouble if p(2) is near zero.
Good luck,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|