← All Tutorials

Tutorial 4: Handling Overdispersion

Step 2: Choose the Link Function

2
3
4
5
6

Same Link Function as Poisson

The link function choice is the same for Negative Binomial as for Poisson. Both model counts, so both need a link that ensures positive predictions. The key difference between the models is the distribution, not the link.

Step 2: Select the Link Function

Which function should map the linear predictor to expected counts?

Hint: We need g() such that g-1(Xβ) is always positive.

Link Function Selected: Log

With the log link, your model equation is:

ln(E[cnt]) = β0 + β1·temp + β2·hum + β3·windspeed + ...

The log link is identical for Poisson and Negative Binomial. The difference will be in the distribution (variance function).

✔ Correct! Log link is the standard choice.

The log link is the canonical link for both Poisson and Negative Binomial regression:

Key insight: The link function is the same for Poisson and Negative Binomial. Both model counts, so both need the log link to ensure positive predictions. The difference is in the variance function, not the link.

⚠ Historically used, but not recommended today.

The square root link was sometimes used for count data:

Modern practice: The log link is strongly preferred because exp(β) gives interpretable rate ratios. Try selecting Log Link instead.

❌ Not appropriate for count data!

The identity link is problematic for counts:

Example: With β0 = 100 and a large negative coefficient on temperature, cold days could predict -50 bike rentals. That's impossible!

❌ Wrong data type - logit is for probabilities!

The logit link is designed for binary/proportion outcomes:

Data type mismatch: Logit constrains output to [0,1]. Our bike rentals range from 22 to 8,714 - way outside this range!