Re: GAUSS_FUNCT problem [message #38308 is a reply to message #38230] |
Mon, 01 March 2004 01:13   |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Michael Wallace <mwallace.removethismunge@swri.edu.invalid> writes:
>> Well, I can half-heartedly defend the existing code. Note that if one
>> supplies 5 or 6 terms (linear or quadratic background) then GAUSS_FUNCT
>> properly returns an array when A[2] = 0. In the case of 3 terms you
>> are computing a function which only consists of a Gaussian with a sigma
>> width of 0, which probably indicates that you have made an earlier
>> mistake. So I don't begrudge GAUSS_FUNCT returning an anomalous result.
>
> I understand your point, however the documentation clearly states that
> an array will be returned in *all* cases. This particular case, no
> matter how improbable or illogical it may be, is an allowable input. My
> issue isn't so much about the behavior of the procedure, but rather that
> the documentation doesn't match what the procedure does in every case.
Michael, I understand where you are coming from, and you are right,
GAUSS_FUNCT is wrong. (*) I can see that in the course of fitting with
GAUSSFIT, it's quite possible that the "sigma" parameter might head
towards zero, but I'm at a loss as to why it would get stuck right at
zero... unless you set it there to begin with? "Doctor it hurts when
I do this." "Then don't do that."
(*) I think this is a dog food problem. Namely, that RSI is not
eating enough of its own dog food, so it isn't finding its own bugs.
[ For non-nerds, "eating your own dogfood" = "using your own code" ]
I can also gently direct you to MPFITPEAK, which is a plug in
replacement for GAUSSFIT, but doesn't have any of that ugly RSI code
in it, :-) and is built on the robust MPFIT fitting engine.
Craig
http://cow.physics.wisc.edu/~craigm/idl/idl.html (under fitting)
|
|
|