lecture 21: more fitting - astronomybelz/phys3730/lab21/lecture21.pdfreplace with the...

19
Lecture 21: More Fitting Physics 3730/6720 Fall Semester 2019 A bunch of fittings

Upload: others

Post on 26-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Lecture 21: More Fitting

Physics 3730/6720Fall Semester 2019

A bunch of fittings

Page 2: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

replace

With the “chi-squared”

function:

thus replace

The problem of fitting data with normally distributeduncertainties is reduced to a matter of finding the model parameters that minimize the chi-squared.

Page 3: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Direct minimization of c2 ...

Page 4: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 5: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 6: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 7: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 8: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 9: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 10: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 11: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 12: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Grid Search minimization of c2 ...

Page 13: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

● “c2 parabola”● Also can tell us

about uncertainty in fit parameters…

● c2 + 1 → B ± σB

Grid Search minimization of c2 ...

Page 14: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Analytic Minimization of c2

Page 15: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Analytic Minimization of c2

Page 16: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Evaluating Fits: c2

● Definition of c2

● Absolute magnitude of c2 only has meaning relative to the number of degrees of freedom

● #DOF = (# of data points) - (# parameters determined from the data)

● #DOF = (# of data points) - (# constraints)

● c2 /#DOF ~ 1 for good fit● What would “zero degrees of freedom” mean?

Page 17: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

“Goodness of Fit” or “Quality Factor”

● Evaluated by means of “upper incomplete gamma function” in scipy.special.gammaincc

● Also known as “p-value” or “chance probability”● Probability that in a large ensemble of

experiments, a c2 as large or greater as that of the current measurement is found.

Page 18: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Additional Reading:

Taylor: An Introduction to Error Analysis

Bevington: Data Reduction and Error Analysis for the Physical Sciences

Press et al, Numerical Recipes

Page 19: Lecture 21: More Fitting - Astronomybelz/phys3730/lab21/lecture21.pdfreplace With the “chi-squared” function: thus replace The problem of fitting data with normally distributed

Additional Reading:

Taylor: An Introduction to Error Analysis

Bevington: Data Reduction and Error Analysis for the Physical Sciences

Press et al, Numerical Recipes