[AstroPy] astropy.modeling.fitting.LevMarLSQFitter

Joe Ninan indiajoe at gmail.com
Thu Nov 1 12:48:42 EDT 2018


Hi Jon,

On Thu, 1 Nov 2018 at 11:44, Jonathan Loveday <j.loveday at sussex.ac.uk>
wrote:

> Hi astropy.modelling developers
>
> A couple of points regarding this class:
>
> 1. The documentation
> http://docs.astropy.org/en/stable/api/astropy.modeling.fitting.LevMarLSQFitter.html#astropy.modeling.fitting.LevMarLSQFitter
> states:
>
> weights : array (optional)
> Weights for fitting. For data with Gaussian uncertainties, the weights
> should be 1/sigma.
>
> This should of course read "the weights should be 1/sigma^2” (unless the
> code is squaring the weights, which would be very confusing).
>
>
In the code, the multiplication of the residuals by 1/sigma is done before
the final squaring  and summing of the residuals for minimisation.
This is also consistent with how one would implement the weight inside the
residue function if they use scipy.optimize.leastsq
So atleast in the current implementation the user should provide 1/sigma as
weights of heteroscedastic data.

-cheers
joe
_______________________________________________

> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
>


-- 
/---------------------------------------------------------------
"GNU/Linux: because a PC is a terrible thing to waste" -  GNU Generation

************************************************
Joe Philip Ninan
Postdoctoral Researcher
525 Davey Lab,
Dept. of Astronomy & Astrophysics
The Pennsylvania State University
University Park, PA-16802
------------------------------------------------------------
Website: https://indiajoe.gitlab.io/
My GnuPG Public Key: https://indiajoe.gitlab.io/files/JPN_public.key
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20181101/e7c206b6/attachment.html>


More information about the AstroPy mailing list