In Poisson regression the count y has mean μ=ewx (one weight, no intercept). The data are (x,y)=(1,1) and (2,3). What are the log-likelihood, its gradient and Hessian, and the result of two Newton steps from w=0?

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

What's being asked

Whether you can derive the score and Hessian of a GLM with the canonical log link and use them in a Newton (IRLS) update.

Key idea

The log-likelihood is ℓ(w)=∑i(yiwxi−ewxi)+const, with score ∑ixi(yi−μi) and Hessian −∑ixi2μi. The Newton step is w←w+score/∑xi2μi.

Steps

  1. The Poisson probability is P(y)=μye−μ/y!. Taking logs with μ=ewx gives y wx−ewx−ln⁡y!. Summing over the data gives ℓ(w) as above.
  2. Differentiate once: ℓ′(w)=∑ixi(yi−μi), where μi=ewxi. This is the usual 'input times residual' form of a canonical-link GLM.
  3. Differentiate again: ℓ′′(w)=−∑ixi2μi<0. So ℓ is concave and Newton steps head for the unique maximum.
  4. Step 1 from w=0: all μi=1. The score is 1(1−1)+2(3−1)=4 and ∑xi2μi=1+4=5. So w1=0+4/5=0.8.
  5. Step 2 from w=0.8: μ1=e0.8=2.2255 and μ2=e1.6=4.9530. The score is 1(1−2.2255)+2(3−4.9530)=−1.2255−3.9061=−5.1316. The curvature term is 1⋅2.2255+4⋅4.9530=22.038. So w2=0.8−5.1316/22.038=0.567.
  6. Note that step 1 overshot (the score changed sign), which is typical of a first Newton step when the curve is steep. Step 2 gets to 0.567. The exact maximiser solves 2e2w+ew−7=0, which gives w≈0.493, so one or two more steps are needed. Newton's method converges quickly once it is close to the maximum.

Common mistakes

How long your answer should be

Half a page; 5 minutes.

Read this

Previous in Supervised learning: A hard-margin linear SVM is trained on (0,0) with label −1 and on (3,0), (0,3) and (4,4) with label +1. Find w, b, the margin and the dual variables αi. Which points are support vectors?
Next in Supervised learning: Two classes have one-dimensional Gaussian class-conditional densities with the same variance σ2, means μ1<μ2 and priors P(C1), P(C2). What is the Bayes decision boundary x∗ (derive it), and what is it for μ1=0, μ2=4, σ2=1, P(C1)=0.9, P(C2)=0.1, and which class is predicted at x=2.4?