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

Home » Public Forums » archive » mpfit with asymmetric errors?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
mpfit with asymmetric errors? [message #87760] Wed, 26 February 2014 06:29 Go to next message
dg86 is currently offline  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 #87774 is a reply to message #87760] Wed, 26 February 2014 14:44 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
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
Re: mpfit with asymmetric errors? [message #87781 is a reply to message #87774] Wed, 26 February 2014 16:22 Go to previous message
dg86 is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Setting axes range in function graphics
Next Topic: OS X Mavericks

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

Current Time: Wed Oct 08 13:55:20 PDT 2025

Total time taken to generate the page: 0.00554 seconds