mpfit with asymmetric errors? [message #87760] |
Wed, 26 February 2014 06:29  |
dg86
Messages: 118 Registered: September 2012
|
Senior Member |
|
|
Dear Folks,
Does anyone have experience using mpfit to fit experimental data with
asymmetric error bars? My understanding is that the ERR parameter
represents symmetric 1 sigma errors. Is there a straightforward way to
account for the asymmetric case?
Many thanks,
David
|
|
|
|
Re: mpfit with asymmetric errors? [message #87781 is a reply to message #87774] |
Wed, 26 February 2014 16:22  |
dg86
Messages: 118 Registered: September 2012
|
Senior Member |
|
|
On Wednesday, February 26, 2014 5:44:12 PM UTC-5, Craig Markwardt wrote:
> On Wednesday, February 26, 2014 9:29:01 AM UTC-5, David Grier wrote:
>
>>
>
>> Does anyone have experience using mpfit to fit experimental data with
>
>> asymmetric error bars? My understanding is that the ERR parameter
>
>> represents symmetric 1 sigma errors. Is there a straightforward way to
>
>> account for the asymmetric case?
>
>
>
> It can be done. You have to use MPFIT() instead of MPFITFUN(). With MPFIT you return the normalized residuals, so you can normalize them in any way you wish. In your user function, you would normalize the positive residuals by the "positive sigma" and the negative residuals by the "negative sigma." You can use the standard FUNCTARGS approach to pass these values into your user function.
>
>
>
> Happy fitting,
>
> Craig Markwardt
Well, that's just outstanding. Thanks very much indeed.
TTFN,
David
|
|
|