Re: MPFIT .TIED [message #92280 is a reply to message #92278] |
Tue, 10 November 2015 07:49   |
Dick Jackson
Messages: 347 Registered: August 1998
|
Senior Member |
|
|
On Tuesday, 10 November 2015 07:08:15 UTC-8, wouter.sc...@gmail.com wrote:
> Dear All,
>
> I'm using MPFITFUN to find Gaussian shapes among some datasets. Mostly I'm interested in 2D Gaussian shapes (i.e. having a sigma-x and sigma-y). Additionally, I would like to tie both Gaussian sigma parameters to eachother in the sense that sigma-x cannot be bigger than e.g. 5*sigma-y, and vice versa as well (e.g. sigma-y cannot be bigger than 5*sigma-x).
>
> As I understand I can tie one parameter to another by specifing the parinfo[X].tied. The examples show how I can set one parameter equal to another. However, I have not been successfull in specifing a tied relation that covers a certain range (.2*Sx < Sy <= Sx < 5*Sy). Is this even possible?
>
> Thanks in advance!
> Cheers,
>
> Wouter
Hi Wouter,
I think what will work is to have one of the two (say, Sx) be a regular parameter, and have a "ratio" parameter (say, SyOverSx) that might start at 1.0 and be limited (using parinfo.limits and parinfo.limited) to [0.2, 5.0]. Then in your function, compute Sy as (Sx * SyOverSx) and use that. Sy and Sx will always stay within the relative range you're looking for.
I know this was brief, but does it give you enough to go on?
Cheers,
-Dick
Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
|
|
|