I am trying to determine the goodness of fit of a probability distribution.
The following code finds the parameters of a gamma distribution that fits the data, which is sampled from a normal distribution. How do you determine the goodness of fit, such as the p value and the sum of squared errors?
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gamma, weibull_min
data = [9.365777809285804, 10.003993870567362, 13.466830761197965, 12.234118621249575, 9.513899598043404, 12.121054741663144, 9.444676087568094, 8.34435149264849, 11.197115443834104, 7.587318243399245, 10.062775106719538, 12.94630113898219, 10.673778296664242, 8.053223083451728, 9.425896636827629, 9.451727334956606, 11.431408020060903, 12.895152907633685, 8.824001936487837, 11.102630204823061]
shape, loc, scale = gamma.fit(data, floc=0)
print(shape, loc, scale)