[SciPy-dev] least squares error

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Mar 9 16:47:36 EDT 2009


On Mon, Mar 9, 2009 at 3:37 PM, Nils Wagner
<nwagner at iam.uni-stuttgart.de> wrote:
> On Mon, 9 Mar 2009 06:16:03 -0700
>  Ondrej Certik <ondrej at certik.cz> wrote:
> - Show quoted text -
>> Hi,
>>
>> I think each time I used leastsq, I also needed to
>>calculate the
>> errors in the fitted parameters. I use this method, that
>>takes the
>> output of leastsq and returns the parameters+errors.
>>
>> def calc_error(args):
>>    p, cov, info, mesg, success = args
>>    chisq=sum(info["fvec"]*info["fvec"])
>>    dof=len(info["fvec"])-len(p)
>>    sigma = array([sqrt(cov[i,i])*sqrt(chisq/dof) for i
>>in range(len(p))])
>>    return p, sigma
>>
>> let's integrate this with leastsq? E.g. add a new key in
>>the info dict?
>>
>> Ondrej
>> _______________________________________________
>> Scipy-dev mailing list
>> Scipy-dev at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
> Hi,
>
> there is another issue concerning least squares
>
> http://projects.scipy.org/numpy/ticket/937
>
> Nils

ticket 937 is for numpy.linalg.lstsq
while I assume Ondrej meant scipy.optimize.leastsq

Namespaces would be nice.

Josef



More information about the SciPy-Dev mailing list