goodness-of-fit

How to perform a chi-squared goodness of fit test using scientific libraries in Python?

南楼画角 提交于 2019-12-03 11:16:45
问题 Let's assume I have some data I obtained empirically: from scipy import stats size = 10000 x = 10 * stats.expon.rvs(size=size) + 0.2 * np.random.uniform(size=size) It is exponentially distributed (with some noise) and I want to verify this using a chi-squared goodness of fit (GoF) test. What is the simplest way of doing this using the standard scientific libraries in Python (e.g. scipy or statsmodels) with the least amount of manual steps and assumptions? I can fit a model with: param = stats

goodness of fit in pymc and plotting discrepancies

試著忘記壹切 提交于 2019-12-02 14:53:23
问题 I'm using PYMC 2.3.4. I found terrific. Now I would like to do some goodness of the fit and plot discrpancies how shown in section 7.3 of the documentation (https://pymc-devs.github.io/pymc/modelchecking.html) In the documentation they say that you need 3 inputs for the discrepancy plot x: the data x_sim: the posterior distribution sample x_exp:expected value I can understand the first two but not the third This the code Sero=[0,1,4,2,2,7,13,17,90] Pop=[ 15,145,170,132,107,57,68,57,251] for i

goodness of fit in pymc and plotting discrepancies

这一生的挚爱 提交于 2019-12-02 11:21:47
I'm using PYMC 2.3.4. I found terrific. Now I would like to do some goodness of the fit and plot discrpancies how shown in section 7.3 of the documentation ( https://pymc-devs.github.io/pymc/modelchecking.html ) In the documentation they say that you need 3 inputs for the discrepancy plot x: the data x_sim: the posterior distribution sample x_exp:expected value I can understand the first two but not the third This the code Sero=[0,1,4,2,2,7,13,17,90] Pop=[ 15,145,170,132,107,57,68,57,251] for i in range(len(Pop)): prob[i] = pymc.Uniform(`prob_%i' % i, 0,1.0) serobservation=pymc.Binomial(

Keypoint Descriptor Matching: How to calculate a goodness-of-fit per template?

梦想的初衷 提交于 2019-12-01 11:43:35
问题 I am not sure whether this belongs on stackoverflow or another stackexchange site - input very welcome here. I have used python OpenCV to match a target image's BRISK keypoint descriptors to - in turn - three different templates. What is a practical, robust, statistically-sound way to decide which template is the best-fitting one? Right now I calculate the number of cv2.RANSAC inliers returned by cv2.findHomography (which incidentally doesn't return a goodness-of-fit statistic) and take the