[SciPy-User] least square fit with weight in linalg.lstsq

Xunchen Liu xunchen.liu@gmail....
Tue Dec 7 13:25:25 CST 2010


Hello,

I don't know if there is option to have weighting in least square fit?
attached is the code I use linalg.lstsq to fit 4 parameters out of 6
measurement.
Also, how can I read the uncertainty of each parameters fitted?

Thanks a lot!

Xunchen

==============

freq = np.transpose(np.array ([ (3609.283, 3611.204, 3611.897, 3619.310,
3620.270, 3620.98 )]))

JK =np.array ([ (1,-2,0,4), (1,2,0,-4), (1,4,0,-32), (1,0,1,0), (1,2,1,-4),
(1,4,1,-32)])

c,resid,rank,sigma = linalg.lstsq(JK,freq)

==============
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20101207/bd6e980a/attachment.html 


More information about the SciPy-User mailing list