Fitting models to data (regression) is a core skill in science and engineering. Python provides many ways to do this for linear and nonlinear regression. This booklet focuses primarily on using Numpy and scipy for regression. You will learn how to use functions from these libraries to fit data, estimate parameters and their uncertainties, and how to make predictions with the models including uncertainty estimates on the predictions. The booklet discusses some concepts in model selection and outlier detection. It also provides a basic introduction to some more advanced libraries including statsmodels, lmfit and sklearn.
A PDF and Jupyter notebook with the narrative text and code
- A PDF and Jupyter notebook with the narrative text and code