GLM Fundamentals
This page covers the statistical theory behind the GLM tab. See that page for usage instructions.
Model Formulation
GLM generalizes the normal linear model to the exponential family of distributions, as introduced by Nelder & Wedderburn (1972). A GLM is defined by three components:
- Distribution family: The response variable follows a distribution in the exponential family
- Linear predictor: (a linear combination of explanatory variables)
- Link function: A monotonic function such that , connecting the linear predictor to the mean
OLS is a special case of GLM (Gaussian family with identity link). In this case, IRLS converges in a single iteration to the normal equations solution, and the Wald test is equivalent to the OLS -test.
Exponential Family
A family of distributions is called an exponential family if its density (or mass) function can be written as:
where is the natural (canonical) parameter, is the dispersion parameter, and is the log-partition function. The mean and variance are derived from :
Rewriting as a function of rather than gives the variance function , so . For example, Poisson has , giving and , hence .
Exponential family parameters for each distribution family:
| Family | (natural parameter) | |||
|---|---|---|---|---|
| Gaussian | ||||
| Binomial | ||||
| Poisson | ||||
| Gamma | ||||
| Negative Binomial |
- In the Binomial row, is the proportion of successes (, ), is the number of successes, is the number of trials, and is the success probability. When , it reduces to the Bernoulli distribution
- The in Negative Binomial corresponds to the shape parameter in the MIDAS UI. The Negative Binomial belongs to the exponential family only when is known. In MIDAS's automatic estimation mode, is estimated in an outer loop
- The in this table is the exponential family natural parameter, which is distinct from the Negative Binomial shape parameter in the MIDAS UI
Link Functions
The link function is a monotonic function connecting the linear predictor to the expected value of the response. A link function satisfying (the natural parameter) is called the canonical link.
| Link Function | Formula | Canonical Link For |
|---|---|---|
| Identity | Gaussian | |
| Logit | Binomial | |
| Log | Poisson, Negative Binomial | |
| Inverse | Gamma | |
| Probit | — |
The canonical link has important properties: since , becomes a sufficient statistic for , and the log-likelihood is concave in . When the design matrix has full rank, this guarantees uniqueness of the MLE and stable IRLS convergence.
Non-canonical links forfeit these properties but may be chosen for easier coefficient interpretation. For example, the canonical link for Gamma is Inverse (), which puts coefficients on a scale that is hard to interpret. The Log link ( as a multiplicative effect) is more commonly used in practice.
Parameter Estimation (IRLS)
GLM parameters are estimated by maximum likelihood. Since no closed-form solution exists, IRLS (Iteratively Reweighted Least Squares) is used.
At each iteration, working weights and an adjusted dependent variable are computed, then the weighted least squares problem:
is solved to update . See McCullagh & Nelder (1989, Ch. 2) for the derivation of and . Iteration stops when the maximum absolute change in coefficients falls below the convergence threshold.
With the canonical link, the concavity of the log-likelihood ensures stable convergence. Non-canonical links may lead to slower convergence or convergence failure.
Variance Functions and Overdispersion
As described in the Exponential Family section, the variance function is the second derivative of the log-partition function rewritten in terms of . Through the relationship , it defines the mean-variance relationship for each family.
| Family | ||||
|---|---|---|---|---|
| Gaussian | (= ) | |||
| Binomial | ||||
| Poisson | ||||
| Gamma | ||||
| Negative Binomial |
Poisson and Binomial assume a dispersion parameter . When the actual data variance exceeds this assumption, the condition is called overdispersion. Overdispersion leads to underestimated standard errors and confidence intervals that are too narrow.
When overdispersion is detected with Poisson data, switching to Negative Binomial adds a term to the variance, explicitly modeling the extra dispersion.
For Binomial overdispersion, MIDAS does not currently support quasi-binomial or Beta-Binomial alternatives. When overdispersion is suspected, check the estimated dispersion parameter and consider that standard errors and confidence intervals may be underestimated.
See also
- Generalized Linear Model (GLM) - How to run GLM analysis and interpret results
- OLS Fundamentals - Mathematical background of OLS, a special case of GLM
- GLMM Fundamentals - Generalized linear mixed model theory with random effects
- Glossary - Statistical term definitions
References
- Nelder, J. A., & Wedderburn, R. W. M. (1972). Generalized linear models. Journal of the Royal Statistical Society: Series A, 135(3), 370-384.
- McCullagh, P., & Nelder, J. A. (1989). Generalized Linear Models (2nd ed.). Chapman and Hall/CRC.