From df19fccbbd9e1701b5a23289e04e2813f63d193e Mon Sep 17 00:00:00 2001 From: Frank Sauerburger <frank@sauerburger.com> Date: Tue, 8 Aug 2017 18:38:45 +0200 Subject: [PATCH] Update degrees of freedom in printout Change the degrees of freedom in the printout from 122 to 123. Additionally, change the phrase 'ndf' (number of degrees of freedom) to 'dof' (degrees of freedom) to be more consistent. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9df20fa..aec0e1c 100644 --- a/README.md +++ b/README.md @@ -556,7 +556,7 @@ print("chi^2 from scipy:") # Call chisquare and print. chi2, p = scipy.stats.chisquare(count, fit_count, ddof=dof) -print(" chi2 / ndf = %g / %d" % (chi2, len(count) - dof)) +print(" chi2 / dof = %g / %d" % (chi2, len(count) - dof)) print(" p-value = %g" % p) print() # print blank line @@ -569,7 +569,7 @@ chi2 = ((count - fit_count)**2 / uncertainty**2).sum() # Calculate p-value and print p = scipy.stats.distributions.chi2.sf(chi2, len(count) - 1 - dof) -print(" chi2 / ndf = %g / %d" % (chi2, len(count) - dof)) +print(" chi2 / dof = %g / %d" % (chi2, len(count) - dof)) print(" p-value = %g" % p) ``` @@ -586,11 +586,11 @@ Optimal parameters: b = 0.841156 +- 0.0193703 chi^2 from scipy: - chi2 / ndf = 120.577 / 122 + chi2 / dof = 120.577 / 123 p-value = 0.519418 Manual chi^2 test: - chi2 / ndf = 120.577 / 122 + chi2 / dof = 120.577 / 123 p-value = 0.519418 ``` -- GitLab