Try   HackMD

A.3.6 Chi-Square Distribution

因為我的機器學習課本寫得很簡略,所以關於更詳細的 Chi-Square Distribution 內容我會寫在「補充:Chi-Square Distribution」,可按需要參考,而這篇筆記的內容就只會包含課本的簡略版。


定義

如果

Zi 是 independent unit normal random variables(i.e.
ZiN(0,1)
),則:
X=Z12+Z22+ ... +Zn2

chi-square with
n
degrees of freedom
,即
Xχn2

也就是說:

如果我們有一個 random variable

X,它是
n
個彼此獨立,且皆具 standard normal distribution 的 random variables 的和,那我們就說
X
是 chi square,且有
n
degrees of freedom。

standard normal distribution 即 pdf 為 normal distribution 的 pdf 且

μ=0
σ2=1

特性

mean, variance

chi-square distribution 的 mean 和 variance 為:

E[X]=nVar(X)=2n

n= standard normal random variable 的個數
=
degree of freedom 數

chi-squared distribution from normal-distributed sample

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

wiki 的寫法或許比較清楚:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

課本並沒有給證明,所以我自己證了,可能沒有證得很漂亮,但步驟都有寫清楚:

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

我的證法是計算出左邊的值,證明會等於右邊的 chi-square distribution with

N1 degrees of freedom。

步驟為:

  1. 先算
    m
    的 distribution(最後會用到)
  2. 算出
    t=1N(Xtm)2
  3. 代入
    (N1)S2σ2
  4. 將結果由 chi square distribution 的定義轉換成 chi-squared 的形式

各步驟詳細如下:

  1. Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

  2. Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →

3,4.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

最後

χN2χ12=χN12 的理由如箭頭下方藍字說明,這個 property 課本沒有。反正大意就是:

如果你有一個 chi-square with

N degrees of freedom,你可以任意拆成一個 chi-square with
k
degrees of freedom 和 chi-square with
Nk
degrees of freedom 相加。

至於這個式子為什麼成立,我後來在同章後方的筆記「補充:random functions associated with normal distributions」中的 Thm 5.5-2 有更新,如果有興趣可以參考。