I tried to draw a chi-square qq plot from sample following a bivariate normal distribution. This is my code:
x = pd.DataFrame(np.random.multivariate_normal([0, 0], [[1, 0], [0, 1]], 100000)) def chi2plot(x): m = x.mean() s = x.cov() s_inv = np.linalg.inv(s) d = np.zeros(len(x)) for i in range(len(x)): d[i] = (x.iloc[i,]-m).dot(s_inv).dot(x.iloc[i,]-m) sm.qqplot(d, stats.chi, distargs=(2,), fit=True, line="45") plt.title("chi-square for price and weight") plt.show() return chi2plot(x)
And when I run the code, it returns the qq plot above. I thought dots should be on the diagonal, but for me, the placement of the dots seems to fall significantly from the diagonal. Is this the right result for a sample following bivariate normal distribution with qq plot?