A generalized linear model takes independent responses from an exponential dispersion family and relates their means to linear predictors by . The response distribution, systematic component, link, dispersion, and known observation weights together specify the model.
For a suitably regular generalized linear model, a residual deviance can be compared approximately with a chi-squared distribution on degrees of freedom to assess fit relative to the saturated model. Sparse or very small expected cell counts can invalidate this reference distribution. A large p-value means no detected lack of fit, not proof of correctness; dependence, wrong mean structure or overdispersion still require diagnostics.
A deviance residual is the signed square root of an observation's contribution to fitted-model deviance. For a Poisson regression, , with . Its squared sum is the Poisson deviance. Leverage and estimated dispersion can further standardize these residuals; a normal quantile-quantile plot is a diagnostic approximation, not a requirement that count errors have a normal distribution.
A generalized additive model has linear predictor . Centering the smooth functions identifies the intercept. The response family and link function remain part of the model; an unspecified software family must not be inferred from the response name.
The backfitting algorithm estimates each additive mean function by smoothing its partial residual, obtained after subtracting the current fits of all other terms, and cycling through terms until convergence. Centering each smooth separates its constant part from the intercept. For fixed quadratic smoothness penalties it is block coordinate minimization of a penalized least-squares objective; identifiability and positive definiteness of the constrained problem ensure a unique converged fit. Non-Gaussian generalized additive models can use weighted backfitting inside iteratively reweighted least squares.
A generalized additive mixed model supplements smooth population effects with latent random effects. Given these effects, responses follow a specified response family; integrating them out induces dependence between related observations.
Quasi-likelihood specifies a mean and a variance function without necessarily specifying a full response distribution. For independent responses, the estimating equation is . A common scalar dispersion parameter rescales coefficient covariance while leaving the roots of the quasi-score equation unchanged.
The logit mean model with working variance function has the same coefficient estimates as ordinary binomial logistic regression, but estimates dispersion from residuals. For an actual individual binary random variable, forces variance , so a nonunit dispersion is a working specification rather than a new independent binary distribution.
The linear predictor of a generalized linear model is the linear combination of the explanatory variables.
The logit link maps a mean probability to its log odds: , . Its inverse is , used in logistic regression.
Binomial regression models independent and relates to a linear predictor. Logistic and probit regression use the logit and inverse-normal links respectively.
For independent binomial counts with observed proportions and fitted probabilities , the deviance from the saturated model iswith the usual convention .
The Pearson residual is .
The Pearson chi-squared statistic for a generalized linear model isDividing it by the residual degrees of freedom estimates the dispersion parameter.
The canonical link identifies the linear predictor with the exponential family's natural parameter: , where .
For three distinct times, the columns are linearly independent by the Vandermonde determinant. Thus a quadratic Poisson regression for the log mean can reproduce any three positive time-group means. A grouped goodness-of-fit test of that mean form has zero residual degrees of freedom. Replicated observations still allow checks of the Poisson distribution and overdispersion within each time group; saturation of the mean does not establish the response distribution.
A categorical covariate can be grouped in an interaction term while retaining its original main effect. This shares selected slopes but keeps separate intercepts. Nested Poisson deviance differences test slope pooling and intercept pooling separately.
In a Poisson regression with , the treatment logarithm of the mean ratio at baseline is . The main treatment coefficient tests the contrast at . An overall no-treatment test requires both and , with their joint covariance matrix for a Wald test.
For independent Poisson observations with fitted means , the deviance from the saturated model iswith .
Quasi-Poisson regression uses the mean model and variance relation . It estimates through quasi-likelihood and scales its covariance by the estimated dispersion .
For mean and variance proportional to , the quasi-score is the sum of . Setting it to zero estimates without requiring a full response likelihood.
Negative binomial regression models overdispersed counts with a negative binomial distribution, commonly using a logarithmic link for the mean.
For known size , the negative binomial distribution is an exponential family with natural parameter and cumulant . A generalized linear model can use a logarithmic link function for its mean, even though that link is not canonical. Jointly estimating the size changes the family and variance function, requiring additional updates beyond a single fixed-family GLM fit; this is what
MASS::glm.nb does.For fixed exposures , a Poisson exposure model takes independent observationsIt has mean and variance and is therefore heteroscedastic when the exposures differ.
For , unweighted least squares through the origin and maximum likelihood giveBoth estimators are unbiased.
The two variances areSince by Cauchy-Schwarz, maximum likelihood has no larger variance, with equality when all positive exposures are equal.
For testing against a larger alternative, approximate size- upper-tail tests reject whenor, respectively,
A logistic regression can specify each binary response conditionally on recorded past outcomes and baseline covariates. A chain rule for probabilities gives the path likelihood as the product of the conditional Bernoulli distribution masses. This permits dependence within a person's history without treating their outcomes as unconditionally independent. The model must specify the initial history and which past features enter its conditional mean.
The accumulated number of previous successes may enter the conditional mean in a history-dependent logistic regression. Its coefficient exponentiates to the conditional success odds ratio per previous success. For a specified future path, update this cumulative predictor after each outcome before multiplying the conditional probabilities.
A previous outcome may affect a subsequent outcome after controlling both measured covariates and persistent unobserved heterogeneity. This is true state dependence. An observed lagged-outcome association alone does not establish it, because omitted individual propensities can create apparent persistence.
A regression for a categorical response with more than two possible outcomes, parametrizing log probability ratios relative to a baseline category by linear predictors. It preserves categories that a binary logistic regression would merge.
A logistic-normal count model takes and , where is a stationary unit-variance autoregressive process of order one with coefficient and the independent have normal distribution with variance . The marginal latent variance is , and its off-diagonal covariance is . Random success probabilities produce overdispersion relative to the binomial distribution.
A logistic model maps a real-valued score to the probability , equivalently . Logistic regression takes to be an affine function of the predictors.
Separation in a binary regression model occurs when an affine score assigns all observations from one class to one side of a threshold and all observations from the other class to the other side.
Complete separation means that every signed training margin is strictly positive for some affine score. In unpenalized logistic regression it causes coefficient norms to diverge and prevents a finite maximum-likelihood estimate.
At an interior maximum-likelihood fit of a logistic-regression model containing an intercept, the intercept score function isConsequently the sum of the fitted probabilities equals the number of observed successes exactly.
For a positive semidefinite trace ball , the quadratic-form hypothesis class isIts empirical logistic risk is convex as a function of .
L1-penalized logistic regression minimizes empirical logistic loss plus . Its subgradient optimality conditions set each logistic score coordinate equal to , where off zero and at zero.
For independent grouped counts , grouped-binomial logistic regression specifiesFitting the proportions with binomial weights gives the same likelihood.
With treatment coding, the intercept describes the reference factor level and each displayed factor coefficient is a contrast against that level. Changing the reference level reparametrizes the same fitted model: fitted probabilities and likelihood do not change, but coefficients representing different pairwise contrasts can have different standard errors and p-values.
A stochastic block model assigns each vertex of a graph to a class and, conditional on those classes, makes distinct edges independent random variables whose probabilities depend only on the classes of their endpoints.
For independent Bernoulli distribution upper-triangular entries of a symmetric zero-diagonal adjacency matrix of a graph, put . For a unit vector , has sub-Gaussian variance proxy at most , by the Hoeffding lemma. Hence . The volumetric bound for Euclidean metric nets gives a -metric net of the unit sphere with at most points. The quadratic form net bound gives on that net. The union bound gives ; integrating this tail proves the displayed expectation bound.
An additive class-effect logistic network model gives an edge joining classes and the log odds . A further coefficient multiplying represents a common within-class log-odds effect.
For independent binary edges with log odds , the natural statistics are the sum of the vertex degrees in each class and the total number of within-class edges. They form a minimal sufficient statistic whenever the natural parameter space contains an open subset of .
Binary probit regression sets , where is the standard normal distribution function. Its intercept score is a weighted sum of residuals, so an intercept does not generally force .
For binary observations with success probability , introduce latent and let the sign determine the observation. Given and the observed sign, each latent variable has a truncated normal distribution. With a standard normal prior, the full conditional distribution of is normal with precision and mean . Alternating these blocks is Gibbs sampling with the required marginal posterior.
Observing only whether a lognormally modelled output exceeds a known threshold produces a probit link. The latent location and slope are recovered by multiplying the probit coefficients by the known Gaussian scale and adding the log threshold to the intercept.
For probit regression with and prior , the posterior score control variate isFor , its covariance with the score is . It is nonzero whenever , ensuring strict improvement by the optimal control variate.
IRLS fits a generalized linear model by repeatedly solving a weighted least-squares approximation to its score equations.
A generalized linear mixed model adds latent random effects to the linear predictor of a generalized linear model.
A Gaussian linear mixed model combines fixed effects, random effects with a normal distribution, and independent Gaussian noise. For and independently, its marginal distribution is with . The random effects induce dependence among observations sharing their design columns. A random-intercept linear mixed model and a random-slope linear mixed model are special cases.
A variance component is a nonnegative parameter multiplying a specified covariance contribution. In a Gaussian linear mixed model with independent standardized group effects, describes the covariance induced by one set of random effects. Testing whether a component is zero is a variance-component likelihood-ratio test at a boundary; ordinary regular chi-squared likelihood-ratio calibration need not apply.
A method-of-moments variance component estimate equates residual mean squares in ANOVA to their model expectations and solves for the variance components. An unconstrained estimate can be negative even when the model component must be nonnegative; boundary treatment then requires a stated estimation convention. The method gives point estimates, not certainty about future experiments.
With known covariance parameters, best linear unbiased prediction minimizes prediction-error variance over linear predictors that are unbiased over both observation errors and random effects, for every fixed-effect value. In a Gaussian linear mixed model, the random-effect predictor is , where generalized least squares estimates the fixed effects. Plugging in covariance estimates gives an empirical predictor; its uncertainty must also account for estimating those covariance parameters. It differs from a best linear unbiased estimator of an unknown fixed coefficient.
In a Gaussian linear mixed model with , the conditional multivariate normal distribution of given has mean and covariance matrix . When nonsingular, its mean is also its mode. Estimated parameters yield empirical conditional modes and shrink group deviations toward zero. At a zero variance component the associated effect is degenerate at zero; the covariance formula still applies, whereas formulas involving require limits.
For , this error correlation decreases exponentially with elapsed time and permits irregular observation times. It is the stationary correlation of an Ornstein-Uhlenbeck process. Within a Gaussian linear mixed model, apply it to the errors conditional on random effects; the marginal correlation also includes those effects.
nlme::corCAR1 parametrizes the same correlation by and permits separate grouped time series.Independent Gaussian random intercepts and random slopes give marginal within-group covariance . In
lme4, separate terms (1 | group) and (0 + x | group) impose zero intercept-slope covariance; (1 + x | group) estimates it. This independence restriction depends on the predictor origin: replacing by transforms the intercept effect to , generally correlated with .A Poisson generalized linear mixed model gives a count response a conditional Poisson distribution whose logarithmic mean contains both fixed effects and latent random effects.
A random intercept gives every group a latent additive shift, inducing dependence among observations from the same group.
A random-intercept linear mixed model has the formwhere independent group effects induce positive covariance among observations from the same group.
Articles by others on the same topic
A Generalized Linear Model (GLM) is a flexible framework for modeling a wide variety of response variables and is an extension of traditional linear regression. It generalizes linear regression to allow for response variables that have error distribution models other than a normal distribution. Here are the key components of a GLM: 1. **Random Component**: This refers to the probability distribution of the response variable \(Y\).