廣義線性模型 (Generalized Linear Model)

? ? ? 廣義線性模型(glm)意為利用連接函數(shù)將各種分布(正態(tài)分布,二項(xiàng)分布,泊松分布)假設(shè)下的因變量與自變量想聯(lián)系起來,使用十分廣泛,下面是我之前的筆記,包含letex代碼和相應(yīng)的pdf文件,

letex代碼:

'''

\documentclass{article}

\usepackage{paralist}

\begin{document}

\title{Generate Linear Model Estimation Note}

\author{Xue Zoushi }

\date{April 28, 2016}

\maketitle

The general procedures:

\begin{compactenum}

\item General exponential family format

\begin{equation}

f(y|\theta) = exp \left ( \frac{y\theta + b(\theta)}{a(\phi)} + c(y,\phi) \right)

\end{equation}

\[

\ell(\theta|y) =log[f(y|\theta)]= \frac{y\theta + b(\theta)}{a(\phi)} + c(y,\phi)

\]

\item Some important attributes of log-likelihood

\[ E(Y) = \mu = \frac{\partial b(\theta)} {\partial \theta} \]

\[ E[S(\theta)]= 0 \]

\[ E[\frac{\partial S}{\partial \theta}] = -E[S(\theta)]^2 \]

\[ I(\theta)= Var(S(\theta))= E[S(\theta)]^2 - {E[S(\theta)]}^2 \]

\[ Var(Y) = a(\phi)[\frac{\partial^2 b(\theta)}{\partial \theta ^ 2}] \]

\item Newton-Raphson and Fisher-scoring

The scalar form of Taylor series

\[ \ell(\theta) \equiv \ell(\tilde{\theta}) + (\theta - \tilde{\theta})

\left. \frac{\partial \ell (\theta)}{\partial \theta} \right |_{\theta = \tilde{\theta}} +

\frac{1}{2} (\theta - \tilde{\theta})^2 \left. \frac{\partial \ell^2 (\theta)}{\partial \theta^2}

\right |_{\theta = \tilde{\theta}}\]

Set \( \partial \ell (\theta) / \partial \theta = 0 \) and rearranging terms yields:

\[ \theta \equiv \tilde{\theta} -

\left [ \left . \frac{\partial ^2 \ell (\theta)}{\partial \theta ^2} \right |_{\theta=\tilde{\theta}}\right ]^{-1}

\left [ \left . \frac{\partial \ell (\theta)}{\partial \theta} \right |_{\theta=\tilde{\theta}} \right ] \]

The basic matrix form of Newton-Raphson algorithm:

\begin{equation}

\theta \equiv \tilde{\theta} - [H(\tilde{\theta})]^{-1} S(\tilde{\theta})

\end{equation}

Replace hession matrix with the information matrix (i.e. \( E(H(\theta))= -Var[S(\theta)]= -I(\theta) \)),

we get Fisher scoring algorithm:

\begin{equation}

\theta \equiv \tilde{\theta} - [I(\tilde{\theta})]^{-1} S(\tilde{\theta})

\end{equation}

\item Estimate the coefficient \( \beta \).

Scalar form

\begin{equation}

\frac{\partial \ell (\beta)}{\partial \beta} =

\frac{\partial \ell (\theta) }{ \partial \theta} \frac{\partial \theta }{ \partial \mu }

\frac{\partial \mu }{ \partial \eta } \frac{\partial \eta }{ \partial \beta }

\end{equation}

Some results:

\begin{itemize}

\item

\[ \frac{\partial \ell (\theta)}{\partial \theta} = \frac{y-\mu}{a(\phi)} \]

\item

\[\frac{\partial\theta}{\partial\mu}=\left(\frac{\partial\mu}{\partial\theta}\right)^{-1}=\frac{1}{V(\mu)}\]

\item

\[ \frac{\partial \eta}{\partial \beta} = \frac{\partial X \beta}{\beta}\]

\item

\[ \frac{\partial \ell(\beta)}{\partial \beta} =

(y-\mu)\left( \frac{1}{V(y)} \right)\left(\frac{\partial \mu}{\partial \eta} \right) X \]

\end{itemize}

Matrix form

\begin{equation}

\frac{\partial\ell(\theta)}{\partial \beta} = X^{'} D^{-1} V^{-1}(y-\mu)

\end{equation}

where $y$ is the $n\times1$ vector of observations, $\ell(\theta)$ is the $n\times 1$ vector of log-likelihood

values associated with observations, $V = diag[Var(y_{i})]$ is the $n \times n$ variance matrix of the

observations, $D=diag[\partial \eta_{i} / \partial \mu_{i}]$ is the $n \times n$ matrix of derivatives, and $\mu$

is the $n \times 1$ mean vector.\\

Let $W=(DVD)^{-1}$, we can get:

\[ S(\beta) = \frac{\partial \ell (\theta)}{\partial \beta}

= X^{'} D^{-1}V^{-1}(D^{-1}D)(y-\mu) = X^{'}WD(y-\mu) \]

\[ Var[S(\beta)] =X^{'}WD[Var(y-\mu)]DWX =X^{'}WDVDWX=X^{'}WX \]

\item Pseudo-Likelihood for GLM \\

Using Fisher scoring equation yields

$\beta = \tilde{\beta} +(X^{'}\tilde{W}X)^{-1}X^{'}\tilde{W}\tilde{D}(y-\tilde{\mu})$,

where $\tilde{W},\tilde{D}$, and $\mu$ evaluated at $\tilde{\beta}$. So GLM estimating equations:

\begin{equation}

X^{'}\tilde{W}X\beta = X^{'}\tilde{W}y^{*}

\end{equation}

where $y^{*} = X\tilde{\beta} + \tilde{D}(y-\tilde{\mu}) = \tilde{eta} + \tilde{D}(y-\tilde{\mu})$, and

$y^{*}$ is called the pseudo-variable.

\[ E(y^{*}) =E[X\tilde{\beta} + \tilde{D}(y - \tilde{\mu})] = X\beta \]

\[ Var(y^{*}) = E[X\tilde{\beta} + \tilde{D}(y - \tilde{\mu})] = \tilde{D}\tilde{V}\tilde{D}=\tilde{W}^{-1} \]

\begin{equation}

X^{'}[Var(y^{*})]^{-1}X\beta = X^{'}[Var(y^{*})]^{-1} \Rightarrow X^{'}WX\beta = X^{'}Wy^{*}

\end{equation}

\end{compactenum}

\end{document}

'''

使用emacs編輯,然后使用命令 pdfletex -glm_estimation.tex生成,生成文件在博客園的文件附件中。

下面是生成的pdf文件截圖:

注:這是我博客園的文章遷移過來的 http://www.cnblogs.com/xuezoushi/p/5461293.html

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 文章作者:Tyan博客:noahsnail.com | CSDN | 簡書 聲明:作者翻譯論文僅為學(xué)習(xí),如有侵權(quán)請(qǐng)...
    SnailTyan閱讀 5,498評(píng)論 0 8
  • 文章作者:Tyan博客:noahsnail.com[http://noahsnail.com] | CSDN[...
    SnailTyan閱讀 2,820評(píng)論 0 4
  • 目錄 [TOC] 引言 量化交易是指以先進(jìn)的數(shù)學(xué)模型替代人為的主觀判斷,利用計(jì)算機(jī)技術(shù)從龐大的歷史數(shù)據(jù)中海選能帶來...
    雷達(dá)熊閱讀 1,211評(píng)論 0 2
  • 上周,老師帶我們?nèi)W(xué)校菌房種豆芽。首先我們在盤子上鋪上一張紙,接著我們?yōu)⑸隙棺硬伷剑鼈兙秃孟褚粭l平平的大馬路,...
    _星月_閱讀 344評(píng)論 0 0
  • 小時(shí)候什么書都看,雖然由于各種條件限制也沒能找到很多書看,但我對(duì)文字的喜愛一直沒有中止過,特別喜歡紙質(zhì)書的書墨香!...
    鳳兒DuDu閱讀 461評(píng)論 0 0

友情鏈接更多精彩內(nèi)容