On 6 September 2013 13:19, I. Alejandro Fleischer <[email protected]> wrote: > > It's a variation , of a physical value ("y") in time ("x") (while > cooling) , you have the data measured (xi, yi), but not from x=0. I need to > extrapolate "y" to "x=0", by that equation. > > I know the very basics about statistics, and a beginner in python, I ve > chosen python to work with.
Okay well you'll want numpy, scipy and matplotlib if you don't have those. Most documentation for those assumes familiarity with Python so you may want to work through a bit of a python tutorial first (if you haven't already). Then I'd suggest first writing a script that can just plot your data-points using matplotlib. Then for your actual fitting problem you'll want to use leastsq from scipy's optimize module. See section 5.4 in this link: http://www.tau.ac.il/~kineret/amit/scipy_tutorial/ Here's a basic example of how to use the function: from scipy.optimize import leastsq # The "true values" amin = 2 bmin = 3 # The residual as a function of the parameters a and b def residual(ab): a, b = ab return [amin - a, bmin - b] # Initial estimate of parameters a and b aguess = 0 bguess = 0 # Fitted values from fitting algorithm (afit, bfit), _ = leastsq(residual, (aguess, bguess)) print('afit: %s' % afit) print('bfit: %s' % bfit) Oscar _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
