A little intro into fitting data using Python, including uncertainty (error) estimates for the best-fit parameters.

link to Jupyter Python notebook hosted on Github — this is the file so you can see what it looks like and download it if you want to. It is in the public domain, you can copy and edit as you wish.

This does fitting via least-squares, then uses first the jackknife then the bootstrap method, and the standard error method to assess the uncertainties in fit parameters.

The jackknife estimate of the variance is calculated according to the formula in the Wikipedia page. Bootstrap Wikipedia page is here although I don’t think it is that clear. This old article is good on the basic idea behind the bootstrap method.

The notebook linked to above is a continuous work in progress, but here is a blog post with some thoughts from early September. There is another IPython notebook on teaching regression here. It has a very different approach to mine so is complementary.

### Like this:

Like Loading...