Skip to main content
appended answer 105888 as supplemental
Source Link
chl
  • 54.3k
  • 23
  • 227
  • 388

I am using MATLAB 2012a to run 3 tests. With my data, I obtain very small values, and for the Anderson–Darling (A–D) tests, the results are not even normalized. Please verify my code. I am also using the A–D script which is found at this link.

sample= N;

h1=histfit(sample,30,'weibull');
xdata1 = get(h1(2), 'XData');
ydata1 = get(h1(2), 'YData');
[~,p_weibull_cs,stats_weibull_cs] = chi2gof(ydata1);
[~,p_weibull_ks,stats_weibull_ks] = kstest(ydata1);
p_weibull_ad = AnDartest(ydata1);

@Tom Lane,

I did modify my code and am currently working like this,;

pd3 = fitdist(sample, 'weibull');
dist3 = makedist('Weibull','a',pd3.ParameterValues(1),'b',pd3.ParameterValues(2))
[h_chi_weibull, p_chi_weibull, stats_chi_weibull]= chi2gof(sample,'CDF',pd3)
[h_ad_weibull, p_ad_weibull, adstat_weibull,cv_ad_weibull]= adtest(sample,'Distribution','weibull')

[h_ks_weibull, p_ks_weibull, ksstat_weibull,cv_ks_weibull]= kstest(sample,'CDF',dist3)

NOW MY PROBLEM IS THE CHI TEST IS RETURNING ONLY 1 OR 0, NOT VALUES IN BETWEEN..

I am using MATLAB 2012a to run 3 tests. With my data, I obtain very small values, and for the Anderson–Darling (A–D) tests, the results are not even normalized. Please verify my code. I am also using the A–D script which is found at this link.

sample= N;

h1=histfit(sample,30,'weibull');
xdata1 = get(h1(2), 'XData');
ydata1 = get(h1(2), 'YData');
[~,p_weibull_cs,stats_weibull_cs] = chi2gof(ydata1);
[~,p_weibull_ks,stats_weibull_ks] = kstest(ydata1);
p_weibull_ad = AnDartest(ydata1);

I am using MATLAB 2012a to run 3 tests. With my data, I obtain very small values, and for the Anderson–Darling (A–D) tests, the results are not even normalized. Please verify my code. I am also using the A–D script which is found at this link.

sample= N;

h1=histfit(sample,30,'weibull');
xdata1 = get(h1(2), 'XData');
ydata1 = get(h1(2), 'YData');
[~,p_weibull_cs,stats_weibull_cs] = chi2gof(ydata1);
[~,p_weibull_ks,stats_weibull_ks] = kstest(ydata1);
p_weibull_ad = AnDartest(ydata1);

@Tom Lane,

I did modify my code and am currently working like this,;

pd3 = fitdist(sample, 'weibull');
dist3 = makedist('Weibull','a',pd3.ParameterValues(1),'b',pd3.ParameterValues(2))
[h_chi_weibull, p_chi_weibull, stats_chi_weibull]= chi2gof(sample,'CDF',pd3)
[h_ad_weibull, p_ad_weibull, adstat_weibull,cv_ad_weibull]= adtest(sample,'Distribution','weibull')

[h_ks_weibull, p_ks_weibull, ksstat_weibull,cv_ks_weibull]= kstest(sample,'CDF',dist3)

NOW MY PROBLEM IS THE CHI TEST IS RETURNING ONLY 1 OR 0, NOT VALUES IN BETWEEN..

deleted 36 characters in body; edited title
Source Link
Nick Stauner
  • 12.4k
  • 5
  • 53
  • 110

testing for Testing goodness of fit

I am using MatlabMATLAB 2012a to run those 3 tests. When i run withWith my data, all the time I obtain very small values, and for the ADAnderson–Darling (A–D) tests, the results are not even normalized. pleasePlease verify my code. I am also using the A-DA–D script which is found at this link enterthis link description here.

sample= N;

h1=histfit(sample,30,'weibull');
xdata1 = get(h1(2), 'XData');
ydata1 = get(h1(2), 'YData');
[~,p_weibull_cs,stats_weibull_cs] = chi2gof(ydata1);
[~,p_weibull_ks,stats_weibull_ks] = kstest(ydata1);
p_weibull_ad = AnDartest(ydata1);

testing for goodness of fit

I am using Matlab 2012a to run those 3 tests. When i run with my data, all the time I obtain very small values and for the AD tests, the results are not even normalized. please verify my code. I am also using the A-D script which is found at this link enter link description here

sample= N;

h1=histfit(sample,30,'weibull');
xdata1 = get(h1(2), 'XData');
ydata1 = get(h1(2), 'YData');
[~,p_weibull_cs,stats_weibull_cs] = chi2gof(ydata1);
[~,p_weibull_ks,stats_weibull_ks] = kstest(ydata1);
p_weibull_ad = AnDartest(ydata1);

Testing goodness of fit

I am using MATLAB 2012a to run 3 tests. With my data, I obtain very small values, and for the Anderson–Darling (A–D) tests, the results are not even normalized. Please verify my code. I am also using the A–D script which is found at this link.

sample= N;

h1=histfit(sample,30,'weibull');
xdata1 = get(h1(2), 'XData');
ydata1 = get(h1(2), 'YData');
[~,p_weibull_cs,stats_weibull_cs] = chi2gof(ydata1);
[~,p_weibull_ks,stats_weibull_ks] = kstest(ydata1);
p_weibull_ad = AnDartest(ydata1);
Post Migrated Here from math.stackexchange.com (revisions)
Source Link
Zay
  • 307
  • 1
  • 3
  • 8
Loading