MATLAB中求积分的方法示例;非中心卡方分布的CDF

前段时间,遇到一个求非中心卡方分布累积分布函数的积分的问题,记录一下,自己留用。

1、什么是非中心卡方分布

非中心卡方分布的随机变量是由若干个独立同方差均值不为0的高斯随机变量的平方和得到的。
MATLAB中有函数ncx2pdf(x,d,lamda)可以查看非中心卡方分布的概率密度函数图形
其中d为非中心卡方分布的自由度,lamda为非中心参数;

2、非中心卡方分布的CDF

(1)函数ncx2cdf

示例:

x = (0:0.1:10)';
ncx2 = ncx2cdf(x,4,2);
plot(x,ncx2,'b-','LineWidth',2)
hold on;

在这里插入图片描述
上图是自由度为4,非中心参数为2的卡方分布的CDF

(2)积分的方法
示例1:
ncx2=@(x)ncx2pdf(x,4,2);
a = quadgk(ncx2,0,10)

a =

0.8512
示例2:
x = 0:0.1:10;
ncx2=ncx2pdf(x,4,2);
b = trapz(x,ncx2)

b =

0.8511
(3)利用marcumq函数

marcumq函数与ncx2的cdf关系可以从下面两张图看出在这里插入图片描述
Q = marcumq(a,b) computes the Marcum Q function of a and b, defined by
在这里插入图片描述
where a and b are nonnegative real numbers. In this expression, I0 is the modified Bessel function of the first kind of zero order.

Q = marcumq(a,b,m) computes the generalized Marcum Q, defined by
在这里插入图片描述
where a and b are nonnegative real numbers, and m is a positive integer. In this expression, Im–1 is the modified Bessel function of the first kind of order m–1;

If any of the inputs is a scalar, it is expanded to the size of the other inputs.

c =1-marcumq(sqrt(2),sqrt(10),2)

c =

0.8512

3、高斯随机变量的二次型


在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值