Tutorial by Examples

We create a dataset that we then fit with a straight line $f(x) = m x + c$. npoints = 20 slope = 2 offset = 3 x = np.arange(npoints) y = slope * x + offset + np.random.normal(size=npoints) p = np.polyfit(x,y,1) # Last argument is degree of polynomial To see what we've done: impor...
We use the same dataset as with polyfit: npoints = 20 slope = 2 offset = 3 x = np.arange(npoints) y = slope * x + offset + np.random.normal(size=npoints) Now, we try to find a solution by minimizing the system of linear equations A b = c by minimizing |c-A b|**2 import matplotlib.pyplot as...

Page 1 of 1