姓名:崔少杰 ? ? ? 學(xué)號(hào):16040510021
轉(zhuǎn)載自:http://www.reibang.com/p/d1b7ca81d1af=有修改
【嵌牛導(dǎo)讀】:廣義線性模型雳锋、指數(shù)分布族中的高斯分布、伯努利分布
【嵌牛鼻子】:廣義線性模型羡洁、指數(shù)分布族玷过、高斯分布、伯努利分布
【嵌牛提問】:為什么要有指數(shù)分布族筑煮?
【嵌牛正文】:定義指數(shù)分布族:(指數(shù)分布族的定義符號(hào)有很多版本辛蚊,這里采用的是CS229 描述的寫法,注意PRML的寫法稍有不同真仲,CS229是斯坦福大學(xué)Andrew NG的機(jī)器學(xué)習(xí)課程袋马,PRML是模式識(shí)別機(jī)器學(xué)習(xí)的經(jīng)典書籍)
指數(shù)分布族形式
η 是 自然參數(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ù)分布族形式
指數(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ù)分布族的形式為
指數(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ù)語是canonical link function:g(μ) =η陨仅,用來描述均值(mean)依賴線性預(yù)測(cè)器(linear predictor ),E(Y) =μ,g(μ) =η.
canonical response function 是canonical link function的反函數(shù)。
根據(jù)假設(shè)2铝侵,可以得出
假設(shè)2
根據(jù)假設(shè)1灼伤,假設(shè)服從高斯分布,可以得出
假設(shè)1
高斯分布 η = μ(參考前述高斯分布) 咪鲜,
根據(jù)假設(shè)3:
假設(shè)3
比如 logistic regression 同理:
等式2為伯努利分布的均值
假設(shè)2可得到等式1
假設(shè)1可得到等式3
假設(shè)3可得到等式4