def calcGoodnessOfFit():
    global numberOfDataPoints
    global numberOfParameters
    global fitParameters
    global chiSquared
    global redChiSquared
    global redChiSquaredLimits
    degreesOfFreedom = (numberOfDataPoints - numberOfParameters)
    chiSquared = calcChiSquared(fitParameters)
    redChiSquared = (chiSquared / degreesOfFreedom)
    pValues = [0.95, 0.05]
    redChiSquaredLimits = (stats.chi2.isf(pValues, degreesOfFreedom) / degreesOfFreedom)
def calcGoodnessOfFit():
    global numberOfDataPoints
    global numberOfParameters
    global fitParameters
    global chiSquared
    global redChiSquared
    global redChiSquaredLimits
    degreesOfFreedom = (numberOfDataPoints - numberOfParameters)
    chiSquared = calcChiSquared(fitParameters)
    redChiSquared = (chiSquared / degreesOfFreedom)
    pValues = [0.95, 0.05]
    redChiSquaredLimits = (stats.chi2.isf(pValues, degreesOfFreedom) / degreesOfFreedom)