中文術(shù)語(yǔ)表述加了英文原文,盡量以原文為主,原文在https://see.stanford.edu/materials/aimlcs229/cs229-notes1.pdf
為什么要有指數(shù)分布族:普通線性模型(general linear model)處理二分類等問題受限(除二分類以外,還有一些其他原因),因此定義了廣義線性模型(generalized linear model )來處理這些問題,大部分經(jīng)常碰到的廣義線性模型都是指數(shù)分布族。
定義指數(shù)分布族的“指數(shù)”可能是因?yàn)榍髮?dǎo)方便(這個(gè)是自己想想的,不一定準(zhǔn)確)
定義指數(shù)分布族:(指數(shù)分布族的定義符號(hào)有很多版本,這里采用的是CS229 描述的寫法,注意PRML的寫法稍有不同,CS229是斯坦福大學(xué)Andrew NG的機(jī)器學(xué)習(xí)課程,PRML是模式識(shí)別機(jī)器學(xué)習(xí)的經(jīng)典書籍)
η 是 自然參數(shù)(natural parameter,also called thecanonical parameter)。
T(y) ?是充分統(tǒng)計(jì)量 (sufficient statistic) ,一般情況下就是y。
a(η) 是 對(duì)數(shù)部分函數(shù)(log partition function),這部分確保Y的分布p(y:η) 計(jì)算的結(jié)果加起來(連續(xù)函數(shù)是積分)等于1.
伯努利分布作為指數(shù)分布族的例子(比如在某段時(shí)間內(nèi),廣告被點(diǎn)擊的分布;某段時(shí)間內(nèi),顧客是否進(jìn)店等等):
設(shè) 均值(mean)為 φ,分布 在Y上的取值為{0,1},因此
p(y= 1;φ) =φ;
p(y= 0;φ) = 1?φ
即,調(diào)整φ,得到不同的伯努利分布,一旦設(shè)定好φ,T,a,b都被固定住,就能得到一個(gè)伯努利分布。
如
把上式的右邊改寫成指數(shù)分布族形式
可以看出,
b(y) = 1
T(y) = y
a(η) = -log(1?φ)
η = log (φ/(1-φ))
因此 φ=
這個(gè)就是sigmoid函數(shù)了,也是logistic 函數(shù),Great.
高斯分布作為指數(shù)分布族的例子(線性回歸 linear regression):
假設(shè) σ^2 = 1
(注:If we leaveσ2as a variable, the Gaussian distribution can also be shown to be in the)
exponential family, whereη∈R2is now a 2-dimension vector that depends on bothμandσ. For the purposes of GLMs, however, theσ2parameter can also be treated by considering
a more general definition of the exponential family:p(y;η, τ) =b(a, τ) exp((ηTT(y)?a(η))/c(τ)). Here,τis called thedispersion parameter, and for the Gaussian,c(τ) =σ2;
but given our simplification above, we won’t need the more general definition for the
examples we will consider here.) ?From CS229 lecture notes。
指數(shù)分布族的形式為
可以看出,
當(dāng)然指數(shù)分布族中的成員很多,泊松分布,gamma分布,beta分布等等,碰到需要解決一個(gè)具體問題的時(shí)候(比如要去判斷多少人在一個(gè)時(shí)間段內(nèi)訪問某個(gè)店,也是某一家店需要擴(kuò)張選店的其中一個(gè)依據(jù)),泊松分布是一個(gè)很好的模型,泊松分布恰巧也是屬于指數(shù)分布族。
下面描述一個(gè)方法:如何構(gòu)造一個(gè)廣義線性模型(GLMS)來解決上述問題(如某個(gè)時(shí)間段內(nèi),多少人進(jìn)店)
具體來說,思考一個(gè)分類(classification)問題或者回歸(regression)問題,我們需要預(yù)測(cè)隨機(jī)變量Y是X的函數(shù)(比如多少人進(jìn)店的問題,X是某個(gè)店的獎(jiǎng)勵(lì)政策、近期廣告等等一些特征)
要建立一個(gè)GLM處理這個(gè)問題,首先做三個(gè)假設(shè):
1:給定X、θ,Y的分布服從某個(gè)指數(shù)族分布(nature parameter = η).
2:給定X,目標(biāo)是預(yù)測(cè)E[Y|x](大部分情況下,T(Y) = Y,),即,假設(shè)函數(shù)(hypothesis)h(x) = E[Y|x].
比如線性回歸的hypothesis:
比如logistic regression的hypothesis:
hθ(x) =p(y= 1|x;θ) = 0·p(y=0|x;θ)+1·p(y= 1|x;θ) = E[y|x;θ]
3:η和X線性(叫“指定選擇” design choice 可能更合適):
應(yīng)用三個(gè)假設(shè)舉例如下:
比如 最小二乘(ordinary least square regression),是指數(shù)分布族模型的一種special case。
ordinary least square regression ,Andrew 在9.1寫的是Ordinary least square ,我自己理解為這里講的是ordinary least square regression,)?
Andrew 使用的術(shù)語(yǔ)是canonical link function:g(μ) =η,用來描述均值(mean)依賴線性預(yù)測(cè)器(linear predictor ),E(Y) =μ,g(μ) =η.
canonical response function 是canonical link function的反函數(shù)。
根據(jù)假設(shè)2,可以得出
根據(jù)假設(shè)1,假設(shè)服從高斯分布,可以得出
高斯分布 η = μ(參考前述高斯分布) ,
根據(jù)假設(shè)3:
比如 logistic regression 同理:
等式2為伯努利分布的均值
假設(shè)2可得到等式1
假設(shè)1可得到等式3
假設(shè)3可得到等式4
附原文