Generalized Linear Models (GLM)

Readings and References

The generalized linear model (GLM) is a flexible generalization of ordinary least squares regression. OLS restricts the regression coefficients to have a constant effect on the dependent variable. GLM allows for this effect to vary along the range of the explanatory variables. In particular, a nonlinear function links the linear parameterization to the expected value of the random variable.

Let μ = E(Y) and η = Xβ. The basic structure of GLM is the link function g(μ) = η. Therefore, Y = g-1(Xβ) + ε.

GLM is essentially a non-linear model with the linear parameterization in the expected value of Y. To estimate the model, one needs three components:

  1. Random component, f(ε) or f(Y), specifying the conditional distribution of the response variable given the explanatory variables X. Typically, this distribution is from the exponential family:

    Yf(Y)E(Y)Var(Y)
    Bernoulli(π)0,1πY (1-π)1-Yππ(1-π)
    Poisson(λ)0,1,2,...exp(-λ) λY/Y!λλ
    Normal(μ,σ)(-∞,∞)1/√(2πσ2) exp[-(Y-μ)2/(2σ2)]μσ2
    Gamma(λ,ρ)[0,∞)λρ/Γ(ρ) exp(-λY) Yρ-1ρ/λρ/λ2
    Exponential(λ)[0,∞)λ exp(-λY) 1/λ1/λ2
    Inverse Normal...
    Inverse Gamma...
    ...

  2. A linear predictor which is a linear function of the regressors: η = β0 + β1X1 + ... + βkXk = Xβ
  3. A link function which transforms the expectation of the response to the linear predictor. In other words, the link function describes the relationship between the linear predictor and the mean of the distribution function. The link function must be invertible.

    The table below lists commonly used link functions and their inverse:

    Linkη=g(μ)μ=g-1(η)
    Identityμη
    Logln(μ)exp(η)
    Inverseμ-1η-1
    Inverse-Squareμ-2η-0.5
    Square Rootμ0.5η2
    Logitln[μ/(1-μ)]Λ(η)=exp(η)/[1+exp(η)]
    ProbitΦ-1(μ)Φ(η)
    Log-log-ln[-ln(μ)]exp[-exp(-η)]

To estimate the coefficients for a GLM model, we use maximum likelihood method.

The model interpretation is typically based on the marginal effect defined by ∂E(Y)/∂X. From the definition of the link function in GLM, g(μ) = η or g(E(Y)) = Xβ, we derive the differentiation ∂g(E(Y))/∂X = g' ∂E(Y)/∂X = β, where g' = ∂g(μ)/∂μ. Therefore ∂E(Y)/∂X = β/g'. For the identity link, g' = 1, or ∂E(Y)/∂X = β.

GLM Examples

Given a sample of N observations (Yi,Xi), i=1,...,N, the log-likelihood function is defined for each GLM as follows:
FamilyLinkLog-Likelihood Function: llf(θ)θNotes
Normal(μ,σ)Identity: μ=Xβ -Nln(2πσ2)-1/2∑i=1,...,N(Yi-Xiβ)22 (β,σ)This is a linear model
Normal(μ,σ)Log: ln(μ)=Xβ -Nln(2πσ2)-1/2∑i=1,...,N(Yi-exp(Xiβ))22 (β,σ)Not a log-linear model
Gamma(λ,ρ)Identity: ρ/λ=Xβ N[ρ(ln(ρ)-lnΓ(ρ)] +∑i=1,...,N[(ρ-1)ln(Yi)-ln(Xiβ)-ρYi/Xiβ] (β,ρ)
Exponential(λ)Identity: 1/λ=Xβ i=1,...,N(-ln(Xiβ)-Yi/Xiβ); β
Exponential(λ)Inverse: 1/λ=1/Xβ i=1,...,N(ln(Xiβ)-YiXiβ); β
Poisson(λ)Identity: λ=Xβ i=1,...,NXiβ+Yiln(Xiβ)-ln(Yi!) β
Bernoulli(π)Logit: ln(π/(1-π))=Xβ i=1,...,NYiln(Λ(Xiβ)) +(1-Yi)ln(1-Λ(Xiβ)) βLogit Model
Bernoulli(π)Probit: Φ-1(π)=Xβ i=1,...,NYiln(Φ(Xiβ)) +(1-Yi)ln(1-Φ(Xiβ)) βProbit Model
...

Example 1: Income Earning Equation

Using 20 observations of the hypothetical data series INCOME and EDUCATION of Greene (Table FC.1) in YED20.TXT, we can estimate the generalized linear model (GLM) of INCOME-EDUCATION relationship based on a probability distribution of the exponential family (e.g., normal, gamma, etc..) with a link function (e.g, identity, log, inverse, etc..). Derive the corresponding log-likelihood function for the model and estimate the parameters by maximizing the log-likelihood function.

Example 2: Binary Choice Models

This example (see also, Greene [2012], Example 17.3) examines the effect of a new teaching method on students' grades. We consider the following qualitative regression (or binary choice) model:

GRADE = β0 + β1GPA + β2TUCE + β3PSI + ε

The following variables are avaialble in the data file GRADE.TXT:

Using maximum likelihood estimation method to represent and estimate the generlized linear model of Bernoulli or binomial distribution with logit and probit link, respectively. Explain the estimated marginal effects of new teaching method on students' grade performance.


Copyright© Kuan-Pin Lin
Last updated: 11/05/2012