Chi Squared Homework Problem:
The objective is to investigate least squares fitting, and interpretation of the chi-squared metric.
You are given the data set at (X, Y, SigmaY). Assume the data comes from a process such that it is ideally fit by a linear function.
Y=aX+b
Subdivide the data into (many) blocks of size Nblock long, and do the following tasks:
1) for each block, use a least squares algorithm to find parameters a, b, the associated uncertainties sigmaa and sigmab, and chi-squared.
2) compute the mean and variance for a, b and their uncertainties, as well as the histograms of a, b. What are the relationships between the distribution of the parameters, and the average of their uncertainties?
3) compute the histogram of chi-squared values, and compare with the expected distribution of chi-squared.
Repeat the above steps for block sizes of 5, 10, 20. You must do enough blocks to establish the requested statistics.
The data is at: HERE