import numpy as np
from scipy import stats
The reduced chi-squared statistic is defined as
$$ \chi^2_\nu \equiv \frac{\chi^2_{\rm min}}{\nu}, $$where $\nu$ is the number of degrees of freedom. So in this part we have
$$ \chi^2_\nu = \frac{15.9}{10} = 1.59 $$We can use the CDF of the chi-squared distribution to calculate the probability of getting a value of the reduced chi-squared statistic greater than of equal to 1.59:
$$ P(\chi^2_{\rm min},\nu) = 1 - C_{DF} $$1 - stats.chi2.cdf(15.9, 10)
We find about a 10% chance of getting a value of $\chi^2_\nu$ this large.
In this part we have a a larger value of $\chi^2{\rm min}$, and more degrees of freedom, giving
$$ \chi^2_\nu = \frac{15.9}{100} = 1.59, $$which the same value found in part (a).
Using the CDF again, we the probability of getting this same value of $\chi^2_\nu$ now:
1 - stats.chi2.cdf(159, 100)
The probability is 0.016%. These is a very different probability than than that found in part (b), even though the fits have the same value of $\chi^2_\nu$, which illustrates the hazards of relying on that one simple diagnostic to make judgments. With the larger number of degrees of freedom, a value as large as $\chi^2_\nu = 1.59$ becomes much more improbable.
version_information
is from J.R. Johansson (jrjohansson at gmail.com); see Introduction to scientific computing with Python for more information and instructions for package installation.
version_information
is installed on the linux network at Bucknell
%load_ext version_information
version_information numpy, scipy