当前位置:网站首页>卡方分布和伽马函数(Chi-Square Distribution)
卡方分布和伽马函数(Chi-Square Distribution)
2022-07-28 13:38:00 【Turbo-shengsong】
伽马函数
要定义卡方分布,我们需要首先定义伽马函数:
Γ ( p ) = ∫ 0 + ∞ x p − 1 e − x d x , p > 0 (1) \Gamma(p) = \int_{0}^{+ \infty} x^{p-1} e^{-x} dx, p >0 \tag{1} Γ(p)=∫0+∞xp−1e−xdx,p>0(1)
如果我们使用分部积分,
Γ ( p ) = ∫ 0 + ∞ x p − 1 e − x d x = ∫ 0 + ∞ − x p − 1 d e − x = − x p − 1 e − x ∣ 0 + ∞ − ∫ 0 + ∞ [ − e − x ( p − 1 ) x p − 2 ] d x = ( p − 1 ) Γ ( p − 1 ) (2) \begin{aligned} \Gamma(p) &= \int_{0}^{+ \infty} x^{p-1} e^{-x} dx \\ & = \int_{0}^{+ \infty} -x^{p-1} d e^{-x} \\ & = -x^{p-1} e^{-x} |_{0}^{+ \infty} - \int_{0}^{+ \infty} \left [ - e^{-x} (p-1)x^{p-2} \right] dx \\ &= (p-1) \Gamma(p-1) \tag{2} \end{aligned} Γ(p)=∫0+∞xp−1e−xdx=∫0+∞−xp−1de−x=−xp−1e−x∣0+∞−∫0+∞[−e−x(p−1)xp−2]dx=(p−1)Γ(p−1)(2)
通过这种方式,我们可以证明伽玛函数服从一个有趣的递归关系。
Γ ( p ) = ( p − 1 ) Γ ( p − 1 ) = ( p − 1 ) ( p − 2 ) Γ ( p − 2 ) = ( p − 1 ) ( p − 2 ) ⋯ Γ ( 1 ) (3) \begin{aligned} \Gamma(p) &= (p-1) \Gamma(p-1) \\ &= (p-1) (p-2) \Gamma(p-2) & = (p-1) (p-2) \cdots \Gamma(1) \end{aligned} \tag{3} Γ(p)=(p−1)Γ(p−1)=(p−1)(p−2)Γ(p−2)=(p−1)(p−2)⋯Γ(1)(3)
容易计算
Γ ( 1 ) = 1 (4) \Gamma(1) = 1 \tag{4} Γ(1)=1(4)
因此,我们可以得到
Γ ( p ) = ( p − 1 ) ! (5) \Gamma(p) = (p-1)! \tag{5} Γ(p)=(p−1)!(5)
另外,我们可以计算
Γ ( 1 2 ) = ∫ 0 + ∞ x − 1 2 e − x d x = 2 ∫ 0 + ∞ e − x d x 1 2 = 2 ∫ 0 + ∞ e − u 2 d u = 2 ⋅ 2 π 1 2 ⋅ 1 2 π 1 2 ∫ 0 + ∞ e − u 2 d u = 2 π ⋅ 1 2 = π (6) \begin{aligned} \Gamma(\frac{1}{2}) &= \int_{0}^{+ \infty} x^{-\frac{1}{2}} e^{-x} dx \\ &= 2 \int_{0}^{+ \infty} e^{-x} d x^{\frac{1}{2}} \\ & = 2 \int_{0}^{+ \infty} e^{-u^2} d u \\ & = 2 \cdot \sqrt{2 \pi \frac{1}{2}} \cdot \frac{1}{\sqrt{2 \pi \frac{1}{2}}} \int_{0}^{+ \infty} e^{-u^2} d u \\ & = 2 \sqrt \pi \cdot \frac{1}{2} \\ & = \sqrt \pi \tag{6} \end{aligned} Γ(21)=∫0+∞x−21e−xdx=2∫0+∞e−xdx21=2∫0+∞e−u2du=2⋅2π21⋅2π211∫0+∞e−u2du=2π⋅21=π(6)
卡方分布
如果 x \boldsymbol x x由 n n n个独立同分布(i.i.d.)的随机变量构成, x i ∼ N ( 0 , 1 ) , i = 0 , 1 , ⋯ , n x_i \sim \mathcal N(0, 1), i=0,1,\cdots, n xi∼N(0,1),i=0,1,⋯,n,那么
y = ∑ i = 1 n x i 2 ∼ χ n 2 (7) y = \sum_{i=1}^{n} x^2_i \sim \chi^2_n \tag{7} y=i=1∑nxi2∼χn2(7)
where χ n 2 \chi^2_n χn2 denotes a χ 2 \chi^2 χ2 random variable with n n n degree of freedom. PDF:
p ( y ) = { 1 2 n 2 Γ ( n 2 ) y n 2 − 1 exp − ( 1 2 y ) for y ≥ 0 0 for y < 0 (8) p(y) = \begin{cases} \frac{1}{ 2^{\frac{n}{2}} \Gamma(\frac{n}{2}) } y^{\frac{n}{2}-1} \exp -(\frac{1}{2} y) \ \ \text{for} \ y \geq 0 \\ 0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \text{for} \ y < 0 \end{cases} \tag{8} p(y)={ 22nΓ(2n)1y2n−1exp−(21y) for y≥00 for y<0(8)
其中 Γ ( u ) \Gamma(u) Γ(u)是伽马函数。随机变量 y y y的均值和方差分别为:
E [ y ] = n var [ y ] = 2 n (9) \begin{aligned} \mathbb E[y] &= n \\ \text{var}[y] &= 2n \end{aligned} \tag{9} E[y]var[y]=n=2n(9)
补充
如果 x i ∼ N ( 0 , σ 2 ) , i = 0 , 1 , ⋯ , n x_i \sim \mathcal N(0, \sigma^2), i=0,1,\cdots, n xi∼N(0,σ2),i=0,1,⋯,n,那么
p ( y ) = { 1 σ n 2 n 2 Γ ( n 2 ) y n 2 − 1 exp − ( 1 2 σ 2 y ) for y ≥ 0 0 for y < 0 (10) p(y) = \begin{cases} \frac{1}{ \sigma^n 2^{ \frac{n}{2} } \Gamma(\frac{n}{2}) } y^{\frac{n}{2}-1} \exp -(\frac{1}{2 \sigma^2} y) \ \ \text{for} \ y \geq 0 \\ 0 \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \text{for} \ y < 0 \end{cases} \tag{10} p(y)={ σn22nΓ(2n)1y2n−1exp−(2σ21y) for y≥00 for y<0(10)
这时,随机变量 y y y的均值和方差分别为:
E [ y ] = n σ 2 var [ y ] = 2 n σ 4 (11) \begin{aligned} \mathbb E[y] &= n \sigma^2 \\ \text{var}[y] &= 2n \sigma^4 \end{aligned} \tag{11} E[y]var[y]=nσ2=2nσ4(11)
边栏推荐
- zabbix分布式
- (function(global,factory){
- 【Utils】ServletUtil
- [server data recovery] HP StorageWorks series server RAID5 offline data recovery of two disks
- The default storage engine after MySQL 5.5 is InnoDB.
- Thoughts on the construction of some enterprise data platforms
- Realization of chat room function
- MiniTest--小程序自动化测试框架
- 2022 safety officer-a certificate operation certificate examination question bank simulated examination platform operation
- 【Utils】ServletUtil
猜你喜欢

一些企业数据平台建设的思考

复制excel行到指定行

2022低压电工考试题及答案

ScottPlot入门教程:获取和显示鼠标处的数值

Cv:: mat conversion to qimage error

2022 low voltage electrician examination questions and answers

Open source project - taier1.2 release, new workflow, tenant binding simplification and other functions

爆肝整理JVM十大模块知识点总结,不信你还不懂

HCIP第十天

2022年熔化焊接与热切割考题及在线模拟考试
随机推荐
Install mysql5.7.36 in CentOS
利用反射构建一棵菜单生成树
如何有效进行回顾会议(上)?
Leetcode 1331. array sequence number conversion
Clickhouse architecture and design
树莓派基础 | 总结记录树莓派学习过程中的一些操作
多所“双一流”大学,保研预报名启动!
How to write test cases in software testing technology
Target detection: speed and accuracy comparison (fater r-cnn, r-fcn, SSD, FPN, retinanet and yolov3)
When Xcode writes swiftui code, it is a small trap that compiles successfully but causes the preview to crash
Clickhouse distributed cluster construction
十、时间戳
Another way of understanding the essence of Hamming code
手机滚动截屏软件推荐
468产品策划与推广方案(150份)
软件测试工程师的职业规划
2022 high altitude installation, maintenance, removal of examination question bank and online simulated examination
[utils] fastdfs tool class
如何有效进行回顾会议(上)?
Thrift 序列化协议浅析