axjack's blog

### axjack is said to be an abbreviation for An eXistent JApanese Cool Klutz ###

ガンマ関数とガンマ分布についてのポエム

統計学実践ワークブック第15章にて、"指数分布(λ)はガンマ分布(1, 1/λ)である"、というワンフレーズでつまずいたので、
復習を兼ねてポエムです。なお、以下の議論において、厳密性は度外視している。

ガンマ関数

定義

s > 0 とする。ガンマ関数Γ(s) は次式で定義される。

 \displaystyle \Gamma(s) = \int_0^{\infty}  t^{s-1} e^{-t} dt

性質1: Γ(1) = 1

Γ(1) = 1である。
  \displaystyle \because \Gamma(1) = \int_0^{\infty}  t^{0} e^{-t} dt  = \int_0^{\infty} e^{-t}dt =  \Big [ -e^{-t} \Big ]_0^{\infty} = 1

性質2: Γ(s) = (s-1)Γ(s-1)

Γ(s) = (s-1)Γ(s-1)である。
 \displaystyle \because \Gamma(s) = \int_0^{\infty}  t^{s-1} e^{-t} dt = \int_0^{\infty}  t^{s-1} \Big(-e^{-t}\Big)' dt
 \displaystyle = \Big[  (t^{s-1} )'(-e^{-t})  \Big]_0^{\infty} -  \int_0^{\infty}  (t^{s-1} )'(-e^{-t})  dt
 \displaystyle =  \int_0^{\infty}  (s-1)t^{(s-1)-1}e^{-t}  dt
 \displaystyle =  (s-1) \int_0^{\infty}  t^{(s-1)-1}e^{-t}  dt
 \displaystyle =  (s-1) \Gamma(s-1)

性質3: Γ(n) = (n-1)! where n ∈ ℕ

n>0; n \in N のとき、Γ(n) = (n-1)!である。
∵ 性質1と2より、ガンマ関数は

{\displaystyle 
\Gamma(n) = \begin{eqnarray}
  \left\{
    \begin{array}{l}
      1 \ \rm{if} \ n = 1 \\
       \rm{otherwise} \ (n-1) \Gamma(n-1)
    \end{array}
  \right.
\end{eqnarray}
}

再帰的に記述できる。これは(n-1)!の階乗の再帰的な表現に等しい。

性質4: Γ(1/2) = √π

 \Gamma(\frac{1}{2}) = \sqrt{\pi}   である。

まず、
 \displaystyle I = \Gamma(\frac{1}{2}) =  \int_0^{\infty}  t^{-\frac{1}{2}} e^{-t} dt  = \int_0^{\infty}  \frac{ 1 }{ \sqrt{t} }  e^{-t} dtにて
 \displaystyle t = x^2 と変数変換すると \displaystyle \frac{dt}{dx} = 2xなので、
 \displaystyle  \int_0^{\infty}  \frac{ 1 }{ \sqrt{t} }  e^{-t} dt = \int_0^{\infty}  \frac{ 1 }{ x }  e^{-x^2} 2xdx = 2 \int_0^{\infty}  e^{-x^2} dx
となって、区間(0,∞)のガウス積分  \int_0^{\infty}  e^{-x^2} dx  が現れる。

ガウス積分を計算すると、
 \displaystyle  J = \int_0^{\infty}  e^{-x^2} dx にて、
 \displaystyle  J^2 = \Big(  \int_0^{\infty}  e^{-x^2} dx \Big) \Big( \int_0^{\infty}  e^{-y^2} dy \Big)
 \displaystyle =   \int_0^{\infty}  \int_0^{\infty}   e^{-(x^2+y^2) }  dxdy

ここで、 x = rcos(\theta), y = rsin(\theta) また諸々のヤコビアンの計算により、 dxdy = rdrd\theta とすると、
 \displaystyle J^2  =   \int_0^{\infty}  \int_0^{  \frac{\pi}{2}  }   e^{-r^2 } rdrd\theta  = \frac{\pi}{2}  \int_0^{\infty} \Big(  -\frac{1}{2} e^{-r^2 }   \Big)'  dr
  \displaystyle  = \frac{\pi}{2} \frac{1}{2}   \Big[  e^{-r^2 }   \Big]_{\infty}^{0}  = \frac{\pi}{4}

よって、区間(0,∞)のガウス積分 \displaystyle J = \sqrt{  \frac{\pi}{4} }   なので、
 \displaystyle \Gamma(\frac{1}{2})  = 2J = 2  \sqrt{  \frac{\pi}{4} }  = \sqrt{\pi}

ガンマ分布

定義

a>0, b>0, x ∈(0,∞) として、確率密度関数f(x)が
 \displaystyle   \frac{1}{\Gamma(a) b^a } x^{a-1} exp( {-\frac{x}{b}  } )
と表される連続型確率分布を、ガンマ分布G(a, b) という。

確率分布であること

連続型確率分布が(0,∞)で積分すると1になることを示せば良い。
ここで、 \displaystyle \frac{x}{b} = t とすると \displaystyle  \frac{dx}{dt} = bt より、

 \displaystyle   \int_0^{\infty}  \frac{1}{\Gamma(a) b^a } x^{a-1} exp( {-\frac{x}{b}  } ) dx
 \displaystyle  =  \int_0^{\infty}  \frac{1}{\Gamma(a) b^a } (bt)^{a-1} exp( -t   ) bdt
 \displaystyle  =  \int_0^{\infty}  \frac{1}{\Gamma(a) b^a } b^{a-1} b t^{a-1} exp( -t   ) dt
 \displaystyle  =  \int_0^{\infty}  \frac{1}{\Gamma(a) b^a } b^a t^{a-1} exp( -t   ) dt
 \displaystyle  =   \frac{1}{\Gamma(a)  }  \int_0^{\infty}  t^{a-1} exp( -t   ) dt
 \displaystyle  =   \frac{1}{\Gamma(a)  }  \Gamma(a)  = 1

モーメント母関数

X ~ G(a,b) としてモーメント母関数  M_X(t) を求める。

 \displaystyle M_X(t) = E\Big[ \rm{e}^{tX} \Big]  = \int_0^{\infty}  \rm{e}^{tx}  \frac{1}{\Gamma(a) b^a } x^{a-1} exp( {-\frac{x}{b}  } ) dx
 \displaystyle  =   \int_0^{\infty}  \frac{1}{\Gamma(a) b^a } x^{a-1} exp( {-x (  \frac{1}{b} -t ) } ) dx

ここで  \displaystyle x (  \frac{1}{b} -t ) = y とすると、

 \displaystyle  =   \int_0^{\infty}   \frac{1}{\Gamma(a) b^a } ( \frac{1}{ \frac{1}{b} - t } )^{a-1} y^{a-1} exp( -y )  \frac{1}{ \frac{1}{b} - t } dy
 \displaystyle  =   \int_0^{\infty}   \frac{1}{\Gamma(a) b^a } ( \frac{1}{ \frac{1}{b} - t } )^a y^{a-1} exp( -y )  dy
 \displaystyle  =   ( \frac{1}{1 - bt } )^a  \frac{1}{\Gamma(a) }   \int_0^{\infty}  y^{a-1} exp( -y )  dy
 \displaystyle  =   ( \frac{1}{1 - bt } )^a  \frac{1}{\Gamma(a) }   \Gamma(a)
 \displaystyle  =   ( 1 - bt )^{-a}
となる。

再生性

X ~ G(a1, b) , Y ~ G(a2, b) でXとYは互いに独立であるとする、この時 X+Yの分布はモーメント母関数を用いて
 M_{X+Y}( t ) = M_X(t) M_Y(t) =  (1 - bt )^{-a_1} (1 - bt )^{-a_2} = (1-bt)^{-(a_1+a_2)}
と表される。これは X+Y ~ G(a1+a2, b) に等しい。よってガンマ分布は再生性を持つ。

指数分布(λ)はガンマ分布(1, 1/λ)である

指数分布は確率密度関数 f(x) = \lambda \rm{exp}(-\lambda x) と表される。従って、ガンマ分布 G(a,b)にて
 G(a = 1, b = \frac{1}{\lambda} ) として求めると、
 \displaystyle  G(a = 1, b = \frac{1}{\lambda})   \rightarrow \frac{1}{\Gamma(1) (1/\lambda)^1 } x^{1-1} exp( {-\frac{x}{1/\lambda}  } )
 \displaystyle = \lambda exp( {-\lambda x  } )
となり、確かに一致する。

axjack is said to be an abbreviation for An eXistent JApanese Cool Klutz.