Hi, I have generated 1000 random variables with the triangle distribution. I am then doing a significance test on the variables against the same triangle distribution with the Chi Squared test. However, the test rarely rejects the null hypothesis (i.e. h = 0 & p > 0.05 mostly) which is contradictory in that the test data was generated from the same distribution. Please see my code below. Am I using the chi2gof() function incorrectly?
for i = 1:1000 x = rand; random_vars(i) = icdf('Triangular',x,'a',1,'b',2,'c',4); endpd = makedist('Triangular','a',1,'b',2,'c',4);[h,p] = chi2gof(random_vars,'CDF',pd)
Best Answer