主要内容

ncx2cdf

非中心卡方累积分布函数

语法

p = ncx2cdf(x,v,delta)
p = ncx2cdf(x,v,delta,'upper')

说明

p = ncx2cdf(x,v,delta) 使用 v 中的对应自由度和 delta 中的正非中心参数,计算 x 中每个值的非中心卡方 cdf。xvdelta 可以是向量、矩阵或多维数组,它们都具有相同的大小,这也是 p 的大小。xvdelta 的一个标量输入扩展为维数与其他输入的维数相同的常量数组。

p = ncx2cdf(x,v,delta,'upper') 返回在 x 中每个值处计算的非中心卡方 cdf 的补函数值,它使用更准确地计算极端上尾概率的算法。

一些文献将此分布称为广义瑞利分布、瑞利-莱斯分布或莱斯分布。

非中心卡方 cdf 为

F(x|ν,δ)=j=0((12δ)jj!eδ2)Pr[χν+2j2x]

示例

全部折叠

将具有 DELTA = 2 的非中心卡方 cdf 与具有相同自由度数量 (4) 的卡方 cdf 进行比较:

x = (0:0.1:10)';
ncx2 = ncx2cdf(x,4,2);
chi2 = chi2cdf(x,4);

plot(x,ncx2,'b-','LineWidth',2)
hold on
plot(x,chi2,'g--','LineWidth',2)
legend('ncx2','chi2','Location','NW')

Figure contains an axes object. The axes object contains 2 objects of type line. These objects represent ncx2, chi2.

参考资料

[1] Johnson, N., and S. Kotz. Distributions in Statistics: Continuous Univariate Distributions-2. Hoboken, NJ: John Wiley & Sons, Inc., 1970, pp. 130–148.

扩展功能

全部展开

C/C++ 代码生成
使用 MATLAB® Coder™ 生成 C 代码和 C++ 代码。

版本历史记录

在 R2006a 之前推出