Curve Fitting
(outline goes here)
start
- fit a function to the data from the previous slide using fmin
- write a script that:
- loads the data
- plots your initial guess at a fit
- defines a cost function that is compatible with fmin
- calls fmin to fit the data
- plots the final results for the curve fit
- you will need to assign the variable x and y to the columns of data using matrix slice notation:
- x = data[:,0]# x is the zeroth column
- y = data[:,1]# y is the next column
- here is a template to get you started: curve_fit.py
- If you run this script it will generate a decent curve fit. How can you modify it to get a good curve fit link this one?