[SciPy-User] Fitting data with optimize.curve_fit
Kevin Gullikson
kevin.gullikson at gmail.com
Thu Oct 3 09:17:45 EDT 2013
Have you tried dividing by 60.0 (instead of 60) to get count rate from
counts? Annoying integer arithmetic things can cause issues like this.
Kevin Gullikson
On Tue, Sep 24, 2013 at 7:10 PM, TFSM <tesla.bamf at gmail.com> wrote:
> 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.
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20131003/b026a5e6/attachment.html>
More information about the SciPy-User
mailing list