FUNCTION REFERENCE
chi2gof
Pearson chi-square goodness-of-fit test.
Pearson chi-square goodness-of-fit test.
Syntax
[h,p,stats] = chi2gof(x[,'NBins',n,'CDF',cdf,'Expected',E,'Frequency',f,'EMin',m,'Alpha',a])Options also include Ctrs, Edges and NParams. Default bins are ten equal-width bins over the observations. Expected probabilities extend outer bins to infinity and default to a normal fit with estimated mean and sample standard deviation. A CDF handle or {handle,parameters...} is accepted. Expected supplies counts directly. Only tail bins below EMin (default 5) are pooled inward; interior bins remain. stats contains chi2stat, df, edges, O and E. Nonpositive df gives NaN p and double NaN h.
Example
[h,p,s] = chi2gof([1 2 3],'Ctrs',[1 2 3],'Frequency',[10 20 30],'Expected',[20 20 20],'EMin',0)Differences from MATLAB: vectors only; distribution objects are not supported yet.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.