HansN87 / PHY_445_515

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHY 445/515 Senior Laboratory - Chi-Squared Fitting Example

The code snippets provided by this repository are meant to help beginners learn non-linear fitting. Examples for the following languages/tools are given: PYTHON, R, MATLAB, Mathematica

The toy model assumes a superposition of a gaussian component (signal) on top of an exponentially decaying component (background).

Here the chi-square function is a sum over the expected and observed bin counts and approximates the poisson distribution that governs the number of counts in each bin by the appropriate gaussian distribution.
BEWARE: This is wrong if bins with low number of counts (<~10) exist.

The best-fit parameters are obtained numerically via minimization.

useful links:
https://it.stonybrook.edu/software/title/matlab
https://it.stonybrook.edu/software/title/mathematica
https://it.stonybrook.edu/software/title/python
http://www.scipy.org/about.html
https://it.stonybrook.edu/software/title/r-project
https://www.r-project.org

About


Languages

Language:R 42.0%Language:Python 25.0%Language:MATLAB 20.1%Language:Mathematica 12.9%