I am attempting to check if some data fits to a chi2 distribution with 1 DOF, since it isn't possible to makedist a chi2 distribution I've been using pd = makedist('Gamma', 'a', 1/2, 'b', 2); instead. Which I've read should be equivalent.
When making the qqplot I get some strange behavior from something I would expect to be chi2, for example sampling directly from chi2rng
x = chi2rnd(1, 1e3,1);
pd = makedist('Gamma', 'a', 1/2, 'b', 2);
histogram(x, 'Normalization', 'pdf')
xvals = linspace(0, 10, 100);
plot(xvals, pdf(pd, xvals), 'linewidth', 2)
Returns something not as nice as one would like, this got me thinking: how many quantiles can I really expect from data before concuding it's sufficiently chi2?
Of course this is all good and fine, obviously sampling from chi2rnd should present chi2 distributed variables. The actual context for me is in GLR test, where 2 times the test statistic should be chi2 distributed assuming H0. Making the GLR test on a gaussian sequence results in
looking at the histogram one could be very tempted to call this chi2 distributed, the qqplot however is not quite as convincing. Is this just me nitipicking at high quantiles? It all comes back to what are reasonable expectations in qqplot fits vs large quantiles?