quartz/content/math/statistic/basic_concepot/distribution/gamma_distribution.md
2024-10-10 10:39:11 +08:00

3.2 KiB
Raw Blame History

title tags date
Gamma Distribution
basic
math
statistics
2024-06-03

Background

Gamma Function

Factorial:


n! = \prod_{i=1}^{n} i = 1\times2\times3\times\cdots\times n

那如何计算$\frac{3}{2}!$呢通过对阶乘函数的插值将阶乘函数托展到non-integer value。但是插值的方法有很多要如何选择合适的插值的方法

最重要的条件是,插值后的函数要满足阶乘最重要的条件,


n! = n\times(n-1)!

这个插值后的广义阶乘,就是Gamma Function


\Gamma(z) =  \int_{0}^{\infty} x^{z-1}e^{-x}dx

可以验算,阶乘最重要的性质并没有变,不过形式有所偏移,性质如下:


\Gamma(z+1)=z \times \Gamma(z)

证明如下:

同时在integer节点Gamma function也和阶乘对应起来


\Gamma(n+1) = n!

证明如下:

Exponential Distribution

Exponential Distribution指的是probability of the waiting time between events in a Poisson Process

Here's the exponential distribution explain: Exponential Distribution

Introduction

终于来到我们的主题Gamma Distribution。

在概率论和统计学中Gamma Distribution是一种用途广泛的双参数连续概率分布。Exponential Distribution Erlang Distribution和Chi Distribution是Gamma Distribution的特殊情况。

Gamma Distribution可以被认为是Exponential Distribution的extension相比较于Exponential Distribution only infers the probability of the waiting time for the first event, the Gamma Distribution gives us the probability of the waiting time util the n_{th} event.

Deduction

因为T时间后时间第n次发生了也就意味着在时间t内发生了n-1次事件。


P(T\leq t) = 1 - P(T>t) = 1 - P(\text{0 or 1 or } \cdots \text{n-1 events in t})

so,


P(T\leq t) = 1 - P(T>t) = 1 - \sum_{i=0}^{n-1} \frac{(\lambda t)^{i}e^{-\lambda t}}{i!}

means,


\text{CDF}(t) = 1 - \sum_{i=0}^{n-1} \frac{(\lambda t)^{i}e^{-\lambda t}}{i!}

so,


\text{PDF}(t) = \frac{d}{dt}(1 - \sum_{i=0}^{n-1} \frac{(\lambda t)^{i}e^{-\lambda t}}{i!})

The result:


\text{PDF}(t) = \frac{\lambda e^{-\lambda t}(\lambda t)^{n-1}}{(n-1)!} = \frac{\lambda e^{-\lambda t}(\lambda t)^{n-1}}{\Gamma(n)}

推广到一般形式


\text{Gamma Distribution, } \text{PDF}(x) = \frac{\beta^{\alpha}}{\Gamma(\alpha)}x^{\alpha-1}e^{-\beta x}

$\alpha$相当于之前的第个事件,再在分布中控制着分布的形状;$\beta$相当于之前的\lambda, 为速率参数,也是事件发生的到达率和强度;

同时Gamma Distribution也有另一套等效参数$(k, \theta)$,表现为:


\text{Gamma Distribution, } \text{PDF}(x) = \frac{1}{\Gamma(k)\theta^{k}}x^{k-1}e^{-\frac{x}{\theta}}

其中,k=\alpha, 控制着分布形状,$\beta = \frac{1}{\theta}$,控制着尺度

Reference