[SciPy-User] Fitting data with optimize.curve_fit

TFSM tesla.bamf at gmail.com
Tue Sep 24 20:10:37 EDT 2013


lab1.py <http://scipy-user.10969.n7.nabble.com/file/n18692/lab1.py>  
I have a couple questions. The data show as counts is the total number of
counts in 60 seconds. When using the count rate instead of the total counts
as the y data, curve_fit does not want to give a meaningful answer. It gives
the co-variance as infinity and the cosine that is fit does not match the
data. Using total counts y*60, the co-variance is reasonable and the cosine
fits the data. 

Why does increasing the counts by 60 allow curve_fit to give a reasonable
answer?

A similar problem happens when trying to fit the first harmonic to this
data, A11*cos(3x/pi) + A31*cos(3x/pi) but I must increase the counts
artificially by at least 10 times for curve_fit to give me a curve that
resembles the data being fit.

Is there a better way to fit this data? Is what I am doing here legitimate
artificially increase y to get a fit then just dividing by that amount to
get the data back to count rate? Sorry for the noob questions and thanks.






--
View this message in context: http://scipy-user.10969.n7.nabble.com/Fitting-data-with-optimize-curve-fit-tp18692.html
Sent from the Scipy-User mailing list archive at Nabble.com.



More information about the SciPy-User mailing list