matlab chi2gof,chi2gof函数

function [h,p,stats] = chi2gof(x,varargin)

%CHI2GOF   Chi-square goodness-of-fit test.

%   CHI2GOF performs a chi-square goodness-of-fit test for discrete or

%   continuous distributions.  The test is performed by grouping the data into

%   bins, calculating the observed and expected counts for those bins, and

%   computing the chi-square test statistic SUM((O-E).^2./E), where O is the

%   observed counts and E is the expected counts.  This test statistic has an

%   approximate chi-square distribution when the counts are sufficiently

%   large.

%

%   Bins in either tail with an expected count less than 5 are pooled with

%   neighboring bins until the count in each extreme bin is at least 5.  If

%   bins remain in the interior with counts less than 5, CHI2GOF displays a

%   warning.  In that case, you should use fewer bins, or provide bin

%   centers or edges, to increase the expected counts in all bins.

%

%   H = CHI2GOF(X) performs a chi-square goodness-of-fit test that the data in

%   the vector X are a random sample from a normal distribution with mean and

%   variance estimated from X.  The result is H=0 if the null hypothesis (that

%   X is a random sample from a normal distribution) cannot be rejected at the

%   5% significance level, or H=1 if the null hypothesis can be rejected at

%   the 5% level.  CHI2GOF uses NBINS=10 bins, and compares the test statistic

%   to a chi-square distribution with NBINS-3 degrees of freedom, to take into

%   account that two parameters were estimated.

%

%   [H,P] = CHI2GOF(...) also returns the p-value P.  The P value is the

%   probability of observing the given result, or one more extreme, by

%   chance if the null hypothesis is true.  If there are not enough degrees

%   of freedom to carry out the test, P is NaN.

%

%   [H,P,STATS] = CHI2GOF(...) also returns a STATS structure with the

%   following fields:

%      'chi2stat'  Chi-square statistic

%      'df'        Degrees of freedom

%      'edges'     Vector of bin edges after pooling

%      'O'         Observed count in each bin

%      'E'         Expected count in each bin

%

%   [...] = CHI2GOF(X,'NAME1',VALUE1,'NAME2',VALUE2,...) specifies

%   optional argument name/value pairs chosen from the following list.

%   Argument names are case insensitive and partial matches are allowed.

%

%   The following options control the initial binning of the data before

%   pooling.  You should not specify more than one of these options.

%

%      Name      

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值