A little tutorial (self-contained Jupyter python notebook) example of linear regression, i.e., fitting a straight line (y=mx+c) to noisy data. Includes jackknife and bootstrap estimation of the uncertainties in the values of the intercept & slope
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
gaussian_fit+bootstraperror.ipynb
linear_fit+errors.ipynb
powerlaw_fit+bootstraperror.ipynb

README.md

linear_regression_tutorial-python-

tutorials in Python (inc. numpy & matplotlib) for fitting (also called regression) for three cases:

  1. IPython notebook for fitting a straight line plus bootstrap and other methods for determine uncertainty/error estimates for the best-fit values of the intercept and slope
  2. IPython notebook for fitting a power law plus bootstrap for determine uncertainty/error estimates for the best-fit value of the exponent
  3. (NB bit rough and ready but seems to work OK) IPython notebook for fitting a Gaussian to data - three parameter fit (height, position and width), ie assumes that baseline is zero, or in other words that far from peak, the data tend to zero. If you have baseline you will need to subtract it off before fitting.