Beta distribution and Dirichlet distribution

0. Supplementary knowledge

0.1 Beta function B ( P , Q ) \Beta(P, Q)B(P,Q)

The beta function is also called Euler's first integral and is defined as:
B ( P , Q ) = ∫ 0 1 x P − 1 ( 1 − x ) Q − 1 dx ( P > 0 , Q > 0 ) \begin{aligned } \Beta(P,Q) = \int_0^1x^{P-1}(1-x)^{Q-1}dx \quad (P>0,Q>0) \end{aligned}B(P,Q)=01xP1(1x)Q1dx(P>0,Q>0)
If the beta function is changed into an indefinite integral, there is an incomplete beta function B x ( P , Q ) \Beta_x(P,Q)Bx(P,Q)
B x ( P , Q ) = ∫ 0 x u P − 1 ( 1 − u ) Q − 1 d u ( 0 ≤ x ≤ 1 , P > 0 , Q > 0 ) \begin{aligned} \Beta_x(P,Q) = \int_0^xu^{P-1}(1-u)^{Q-1}du \quad (0\le x \le 1,P>0,Q>0) \end{aligned} Bx(P,Q)=0xuP1(1u)Q1du(0x1,P>0,Q>0)

0.2 Gamma function Γ ( x ) \Gamma(x)C ( x )

The gamma function is also called Euler's second integral and is defined as:
Γ ( x ) = ∫ 0 + ∞ tx − 1 e − tdt ( x > 0 ) = 2 ∫ 0 + ∞ t 2 x − 1 e − t 2 dt \begin{aligned} \Gamma(x) &= \int_0^{+\infin}t^{x-1}e^{-t}dt \quad (x>0)\\ &= 2\int_0^ {+\infin} t^{2x-1}e^{-t^2}dt \end{aligned}C ( x )=0+tx 1 etdt(x>0)=20+t2 x 1 et2 dt
Some properties of the gamma function:

  • Γ ( x + 1 ) = x Γ ( x ) \Gamma(x+1) = x\Gamma(x) C ( x+1)=xΓ(x)
  • Γ ( n ) = ( n − 1 ) ! \Gamma(n) = (n-1)!C ( n )=(n1)!
  • Γ ( 1 2 ) = π \Gamma(\frac{1}{2})=\sqrt{\pi}C (21)=Pi
  • given β \betaβ function relation:B ( m , n ) = Γ ( m ) Γ ( n ) Γ ( m + n ) \Beta(m,n)=\frac{\Gamma(m)\Gamma(n)}{\ gamma(m+n)}B(m,n)=C ( m + n )C ( m ) C ( n )

1. Beta Distribution

Beta distribution , also known as B\BetaB distribution, defined at(0, 1) (0,1)(0,1 ) On the interval, there are two parametersα, β > 0 \alpha,\beta \gt 0a ,b>0 , the random variable obeys the beta distribution and is generally written asX ∼ Be ( α , β ) X\sim \text{Be}(\alpha,\beta)XBe ( a ,b )

1.1 Probability density function PDF

f ( x ; α , β ) = x α − 1 ( 1 − x ) β − 1 ∫ 0 1 u α − 1 ( 1 − u ) β − 1 du = Γ ( α + β ) Γ ( α ) Γ ( b ) x α − 1 ( 1 − x ) β − 1 = 1 B ( α , β ) x α − 1 ( 1 − x ) β − 1 \begin{aligned} f(x;\alpha,\beta) & = \frac{x^{\alpha-1}(1-x)^{\beta-1}}{\int_0^1u^{\alpha-1}(1-u)^{\beta-1}du }\\ &= \frac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1 }\\ &=\frac{1}{B(\alpha,\beta)}x^{\alpha-1}(1-x)^{\beta-1} \end{aligned}f(x;a ,b )=01uα 1 (1u)β 1 duxα 1 (1x)b 1=C ( a ) C ( b )C ( a+b ).xα 1 (1x)β 1=B ( a ,b )1xα 1 (1x)b 1

1.2 Cumulative distribution function CDF

F ( x ; α , β ) = B x ( α , β ) B ( α , β ) \begin{aligned} F(x;\alpha,\beta) = \frac{\Beta_x(\alpha,\beta) }{\Beta(\alpha,\beta)} \end{aligned}F(x;a ,b )=B ( a ,b )Bx( a ,b ).
Among them, B x ( α , β ) \Beta_x(\alpha,\beta)Bx( a ,β ) is an incomplete beta function, defined as:

1.3 Digital features
  1. Definition: μ = E ( X ) = α α + β \mu=E(X)=\frac{\alpha}{\alpha+\beta}m=E ( X )=a + ba
  2. 方差:V ar ( X ) = E ( ( X − μ ) 2 ) = α β ( α + β ) 2 ( α + β + 1 ) Var(X)=E((X-\mu)^2)= \frac{\alpha\beta}{(\alpha+\beta)^2(\alpha+\beta+1)}Var ( X ) _ _=And ( ( _m )2)=( a + b )2 (a+b+1)a b

2. Dirichlet Distribution

Dirichlet distribution is a multivariate generalization of beta distribution. For ddDirichlet distribution in d dimensions, with a total ofddd parameters.
The Dirichlet distribution is about a set ofddd continuous variablesμ i ∈ [ 0 , 1 ] \mu_i\in[0,1]mi[0,1 ] probability distribution; or addProbability distribution of d- dimensional vectors, where vector elementsμ i ∈ [ 0 , 1 ] \mu_i\in[0,1]mi[0,1 ] , and have∑ i = 1 d μ i = 1 \sum_{i=1}^d\mu_i=1i=1dmi=1

2.1 Probability density function PDF
  • μ = ( μ 1 ; μ 2 ; ⋯ ; μ d ) \boldsymbol{\mu} = (\mu_1;\mu_2;\cdots;\mu_d)m=( m1;m2;;md)
  • 令parameters = ( α 1 ; α 2 ; ⋯ ; α d ) \boldsymbol{\alpha}=(\alpha_1;\alpha_2;\cdots;\alpha_d)a=( a1;a2;;ad) α ^ = ∑ i = 1 d α i \hat{\alpha} = \sum_{i=1}^d\alpha_i a^=i=1dai, and α i > 0 \alpha_i > 0ai>0

Given the dependent variable:
p ( µ 1 , µ 2 , ... , µ d ∣ α 1 , α 2 , ... , α d ) = p ( µ ∣ α ) = Dir ( µ ∣ α ) = Γ ( α ^ ) Γ ( α 1 ) Γ ( α 2 ) ⋯ Γ ( α d ) ∏ i = 1 d µ and α i − 1 = Γ ( α ^ ) ∏ i = 1 d Γ ( α i ) ∏ i = 1 d µ i α i − 1 \begin{aligned} p(\mu_1,\mu_2,\dots,\mu_d|\alpha_1,\alpha_2,\dots,\alpha_d) &= p(\ballsymbol{\mu}|\ballsymbol{; \alpha}) = \text{Dir}(\bold symbol{\mu}|\bold symbol{\alpha})\\ &= \frac{\Gamma(\hat{\alpha})}{\Gamma(\alpha_1) \Gamma(\alpha_2)\cdots\Gamma(\alpha_d)}\prod_{i=1}^d\mu_i^{\alpha_i-1}\\ &= \frac{\Gamma(\hat{\alpha}); }{\prod_{i=1}^d\Gamma(\alpha_i)}\prod_{i=1}^d\mu_i^{\alpha_i-1} \end{aligned}p(μ1,m2,,mdα1,a2,,ad)=p(μα)=Dir(μα)=C ( a1) C ( a2)C ( ad)C (a^)i=1dmiai1=i=1dC ( ai)C (a^)i=1dmiai1
Obviously, when d = 2 d=2d=At 2 , the Dirichlet distribution degenerates into the Beta distribution.

2.2 Digital features
  1. Definition: E [ μ i ] = α i α ^ \mathbb{E}[\mu_i] = \frac{\alpha_i}{\hat{\alpha}}E [ mi]=a^ai
  2. 方差:V ar [ μ i ] = α i ( α ^ − α i ) α ^ ( α ^ + 1 ) Var[\mu_i] = \frac{\alpha_i(\hat{\alpha}-\alpha_i)}{ \hat{\alpha}(\hat{\alpha}+1)}V a r [ μi]=a^(a^+1)ai(a^ai)

Guess you like

Origin blog.csdn.net/jasonso97/article/details/124071004