Write a distribution in exponential-dispersion form p(y∣θ)=exp⁡{yθ−b(θ)+c(y)}. How do you show that the Bernoulli and Poisson distributions fit this form, what is the canonical link in each case, and why does a canonical link make the log-likelihood gradient equal to X⊤(y−μ)?

Supervised learning, Generalised linear models
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can put Bernoulli and Poisson in exponential-family form and see that logistic and Poisson regression are the same construction.

Key idea

In this form, E[y]=μ=b′(θ) and Var⁡(y)=b′′(θ) (unit dispersion). The canonical link sets θ=x⊤β directly, that is g=(b′)−1, so the score is ∑i(yi−μi)xi.

Steps

  1. A GLM has three parts: a distribution from the exponential family, a linear predictor η=x⊤β, and a link g with g(μ)=η (μ is the mean of y).
  2. Bernoulli with mean μ: p(y)=μy(1−μ)1−y=exp⁡{ylog⁡μ1−μ+log⁡(1−μ)}. So θ=log⁡μ1−μ (the logit) and b(θ)=log⁡(1+eθ), whose derivative is σ(θ)=μ.
  3. Poisson with mean μ: p(y)=e−μμy/y!=exp⁡{ylog⁡μ−μ−log⁡y!}. So θ=log⁡μ, b(θ)=eθ, and b′(θ)=μ.
  4. The canonical link is the one with g(μ)=θ: the logit for Bernoulli (logistic regression) and log⁡ for Poisson (log-linear count regression). For Gaussian with unit variance it is the identity (ordinary least squares).
  5. Gradient: with θi=xi⊤β, the log-likelihood is ∑i[yixi⊤β−b(xi⊤β)]+const, so ∇=∑i(yi−b′(θi))xi=X⊤(y−μ).
  6. The Hessian is −X⊤diag⁡(b′′(θi))X. Since b′′=Var⁡(y)≥0, the log-likelihood is concave, and the Newton method is IRLS.

Common mistakes

How long your answer should be

One page; 6–8 minutes.

Last checked on 4 December 2026.

Read this

Previous in Supervised learning: Assume y=Xβ+ε with E[ε]=0, Cov⁡(ε)=σ2I and X of full column rank p. How do you prove that E[RSS]=(n−p)σ2, so that σ^2=RSS/(n−p) is unbiased?
Next in Supervised learning: For K-class softmax regression with P(y=k∣x)=ewk⊤x/∑jewj⊤x, derive the gradient of the negative log-likelihood with respect to wk. How do you show that the parameters are redundant (not identifiable), and how is this fixed?