The Log Link
What you'll learn: How the log link function ensures predictions stay positive when modeling count or skewed data with GLMs.
Why We Need the Log Link
In linear regression, the model can predict any value on the real line—positive or negative. But what if you're predicting counts (number of customers, website visits, claims) or strictly positive continuous outcomes (survival times, incomes)? Negative predictions make no sense.
The log link solves this by connecting the linear predictor to the expected outcome through a logarithm.
How It Works
The log link function is:
η = log(μ)
Where:
- η (eta) is your linear predictor: β₀ + β₁X₁ + β₂X₂ + ...
- μ (mu) is the expected outcome (the mean)
Inverting this relationship gives:
μ = exp(η) = exp(β₀ + β₁X₁ + β₂X₂ + ...)
Since the exponential function is always positive for any real input, your predictions μ are guaranteed to be positive—perfect for count data (Poisson distribution) or positive continuous outcomes (gamma distribution).
Real-World Analogy
Think of the log link as a one-way valve: your model can produce any linear combination of predictors (positive or negative), but the exponential transformation "bounces" everything into the positive zone. It's like converting any temperature in Celsius to Kelvin—you can't get negative absolute temperatures.
Coefficient Interpretation
With the log link, a one-unit increase in predictor X changes the log of the expected outcome by β. Equivalently, it multiplies the expected outcome by exp(β). This multiplicative effect is natural for counts and rates.
Key Takeaway: The log link ensures positive predictions by modeling the logarithm of the mean, making it ideal for count data with Poisson or positive continuous data with gamma distributions.