469,611 Members | 1,725 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,611 developers. It's quick & easy.

error estimation in a non-linear least squares fitting

Dear python-users,

I am trying to do a non-linear least squares fitting. Maybe trying is
not the best word, as I already succeeded in that. At the moment I am
using leastSquaresFit from Scientific Python. I know of other least
squares routines, such as the one in scipy.optimize and I believe
there is also one in numpy. Now here is my question: in my search for
a good algorithm, I was not able to find any non-linear least squares
fitting routine which in the end doesn't only give me the parameters
which I asked for, but also the estimated errors on these parameters.
Is there anyone who can help me getting these errors?

Thanks in advance,
Evelien
Oct 15 '08 #1
4 4937
Evelien wrote:
Dear python-users,

I am trying to do a non-linear least squares fitting. Maybe trying is
not the best word, as I already succeeded in that. At the moment I am
using leastSquaresFit from Scientific Python. I know of other least
squares routines, such as the one in scipy.optimize and I believe
there is also one in numpy. Now here is my question: in my search for
a good algorithm, I was not able to find any non-linear least squares
fitting routine which in the end doesn't only give me the parameters
which I asked for, but also the estimated errors on these parameters.
Is there anyone who can help me getting these errors?
In scipy SVN, scipy.optimize.leastsq() will also return a covariance matrix of
the estimate if using full_output=True.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Oct 15 '08 #2
Thanks Robert for your reply. I must say I am kind of disappointed if
that is the only solution. I thought that such a standard problem as
least squares fitting, would always give you an estimation of the
error bars, without having to look up how you can convert a covariance
matrix into error bars...

But thanks anyway.
Evelien
Oct 22 '08 #3
Evelien wrote:
Thanks Robert for your reply. I must say I am kind of disappointed if
that is the only solution. I thought that such a standard problem as
least squares fitting, would always give you an estimation of the
error bars, without having to look up how you can convert a covariance
matrix into error bars...
If you want an all-singing, all-dancing statistics-oriented nonlinear
least-squares interface, you can use scipy.odr. The numerical algorithm in
leastsq() outputs a covariance matrix naturally. Interpreting that to give you
statistical error bars requires some care and judgment. scipy.optimize is not a
statistical package.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco

Oct 22 '08 #4
Ok, then I have to look into scipy.odr to see how it can help me move
forward. Thanks Robert!
Evelien
Oct 29 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Thomas Newman | last post: by
reply views Thread by Sahatra Kumara | last post: by
5 posts views Thread by contactmayankjain | last post: by
1 post views Thread by chris fellows | last post: by
12 posts views Thread by puzzlecracker | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.