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 Gamma distribution with fixed shape , choose dispersion , canonical parameter , and cumulant . The canonical link function is the displayed negative reciprocal; reversing its sign is an equivalent regression convention. For independent observations, the score function is and the Fisher information matrix is . The deviance is , with twice the log-likelihood ratio equal to this divided by . The fitted mean is the inverse link applied to , not itself.
An offset is a known term in a generalized linear model's linear predictor, with coefficient fixed to one. With a log link and exposure , choosing gives a mean count . Its role differs from that of a fitted explanatory-variable coefficient.
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 logistic regression fitted to ungrouped Bernoulli observations has residual deviance . Comparing it automatically with is generally invalid: the saturated dimension grows with , with one observation per fitted probability. If the true model has only an intercept and success probability , then , whereas . Fixed-dimensional nested-model likelihood-ratio tests can still use Wilks theorem under regularity. For absolute fit, use meaningful grouping, residual diagnostics, or a fitted-model parametric bootstrap.
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.
An additive regression model represents a conditional mean as a sum of univariate functions and an intercept. It permits nonlinear effects without estimating a general high-dimensional response surface. The backfitting algorithm smooths each component's partial residual. Centering separates constants from the intercept, while concurvity can still prevent component identification.
// Target: probability-and-statistics.bigb
In an additive regression model, each component can transfer a constant to the regression intercept, so impose empirical mean-zero constraints, or population mean-zero constraints when appropriate. Even after centering, nonzero component perturbations with at every observed point make the additive decomposition nonidentifiable. Extra smoothing penalties may resolve the fitted decomposition, but centering alone does not remove concurvity.
// Target: probability-and-statistics.bigb
Concurvity is the nonlinear analogue of multicollinearity: a function of one predictor is exactly or approximately expressible as a sum of functions of other predictors. Exact concurvity can make an additive decomposition nonunique; approximate concurvity makes components difficult to estimate stably. A unique fitted sum need not imply unique individual components.
// Target: probability-and-statistics.bigb
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.
For linear smoothers, let and . The centered fixed-point equations of the backfitting algorithm have diagonal identity blocks and off-diagonal blocks . On the centered component space, a consistent system has a unique answer exactly when its homogeneous system has only the zero solution. For two components the reduced equation is . A common centered vector reproduced by both smoothers yields opposite perturbations of the components without changing their sum.
// Target: probability-and-statistics.bigb
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 complementary log-log link maps to , with inverse . For constant infection hazard and exposure , implies . Thus a binomial regression with a log-exposure offset estimates the log hazard as its intercept.
The identity link function equates the response mean with the linear predictor. In a generalized linear model it gives . It is the canonical link function for the normal distribution. For response families whose means must remain positive or between zero and one, using the identity link requires corresponding restrictions on the linear predictor.
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 independent counts with means and , let . Maximizing the Poisson regression likelihood in each baseline rate gives the displayed estimate. The remaining log-rate-ratio score isEquivalently, conditional on , the second count has a binomial distribution with success probability . Each positive-total term increases strictly with ; if both treatment totals are positive, the score has a unique positive root. This reduces a many-parameter fit to a scalar equation.
For a full-column-rank design and positive fitted means , the log-likelihood has Hessian , which is negative definite. Thus any finite stationary point is the unique maximum-likelihood estimator. Full rank does not guarantee existence: with an intercept and all counts zero, the supremum is approached as the intercept tends to . If every observed count is positive, a full-rank design does give a finite maximum: each function tends to in either tail and is bounded above, and as , so the negative log-likelihood is coercive.
In Poisson regression with log means , the Fisher information matrix is , where . Inverting this matrix gives slope variance . Writing reduces it to the displayed reciprocal weighted sum of squares. Thus a common intercept consumes information about the overall rate, while slope information comes from the spread of the covariates under the mean-count weights. Constant covariates make the two parameters unidentifiable.
For independent Poisson distributions with log means , where is a known offset, differentiation of the log-likelihood gives the score function . An interior maximum-likelihood estimator therefore satisfies the displayed equations. An intercept and categorical indicator columns make fitted count totals equal observed count totals in each represented factor level. These equations match counts, rather than unweighted averages of rates when exposures differ.
// Target: probability-and-statistics.bigb
For independent aggregate Poisson distributions with means and , conditioning on the total eliminates . Independent Poisson conditioning gives the displayed binomial distribution. Its conditional likelihood is proportional to , also the profile likelihood after maximizing over the unrestricted positive baseline rate. Unequal exposures replace the binomial success probability by .
For conditionally independent paired counts with means and , condition on every pair total . The joint conditional likelihood removes all pair-specific rates, leaving the displayed independent binomial distributions. A zero-total pair contributes no information. With unrestricted fixed baseline rates, this conditional likelihood has the same parameter-dependent part as the ordinary profile likelihood; a specified Gamma–Poisson hierarchical model can retain additional information by imposing structure on those rates.
Consider an approximate conditional likelihood in which a paired total leads to a structural zero with probability , and otherwise a binomial distribution with success probability . For an observed zero, the posterior cure weight is ; for a positive count it is zero. Differentiating the log-likelihood gives the displayed equations at an interior maximum-likelihood estimator, with the weights evaluated at that estimator. Recomputing the weights and then updating the parameters is an expectation-maximization algorithm. Boundary fits must also be considered. These equations describe a conditional mixture: if cure is instead specified before two Poisson distributions are conditioned on their total, its conditional probability generally depends on the total and on the baseline nuisance rate. A zero observed in a short interval is not by itself proof of permanent biological cure.
For a continuous predictor and a categorical factor, an additive Poisson regression with log link has . The log-mean curves are parallel and is constant in . Adding a predictor-by-factor interaction gives , so this ratio becomes . With factor levels, the common-slope restriction has independent constraints. A likelihood-ratio test compares the two deviances with an asymptotic chi-squared distribution on degrees of freedom. Evidence against common slopes establishes varying effects on the log scale; it does not by itself determine their signs or the ordering of the mean curves.
If counts events over days, then the daily average has mean and variance . It is not itself a Poisson variable unless . Known observation periods allow count modelling with a log-exposure offset; otherwise Quasi-Poisson regression may be used as a working mean-variance model, with uncertainty qualified by the missing exposure information.
For independent samples of observations from Poisson distributions with positive means and , the maximum-likelihood estimator of is the displayed difference when both totals are positive. Its asymptotic variance is , obtained by the delta method or by inverting the two-parameter Fisher information matrix. A zero group total makes its log-mean estimate a boundary value; finite normal intervals require nonzero totals.
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 .
Write . For small, the cell contribution to the Poisson deviance expands asSumming gives the Pearson chi-squared statistic as the quadratic approximation. The approximation can be inaccurate for sparse expected counts or cells with relative residuals near minus one.
The full Poisson deviance is . An unpenalized log-mean intercept has likelihood score , which vanishes at an interior fit. The linear terms then cancel, giving the displayed expression. Without that intercept score equation, discarding the linear terms is not justified. Use the limiting convention .
Quasi-Poisson regression uses the mean model and variance relation . It estimates through quasi-likelihood and scales its covariance by the estimated dispersion .
With , define and . The estimating equation and a Taylor expansion give . If responses are independent with correct means and , then and . Consequently the first-order estimator variance is , even if the working Poisson distribution is wrong. Regular asymptotics require growing information and control of leverage and the Taylor remainder.
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.With known size , the mean-dependent log mass of a negative binomial distribution is . Its derivative is , so the saturated mean is , including its boundary value zero. Subtracting the fitted log mass from that maximum gives the displayed deviance. This formula needs no fitted-intercept cancellation. As , its second term tends to and it becomes the full Poisson deviance.
For fixed exposures , a Poisson exposure model takes independent observationsIt has mean and variance and is therefore heteroscedastic when the exposures differ.
For an independent count with a Poisson distribution of mean , the rate estimator has variance . Its fractional standard deviation is , so achieving target fractional precision requires expected count and exposure .
For independently acquired settings with rates , the required total exposure is . Rare settings dominate because they require the same expected count but collect it more slowly. Simultaneous acquisition is a different design, and backgrounds or correlated systematic errors require a different uncertainty calculation.
A rate ratio compares event counts per unit exposure between two conditions. In a Poisson regression with a log link and binary indicator coefficient , it equals . Exponentiating an approximate Wald confidence interval for gives an interval for the rate ratio. A rate ratio is distinct from a relative risk or an odds ratio.
Let independent counts satisfy , with positive known exposures , , and . Their likelihood is proportional to , where . If , the positive maximum-likelihood estimator is ; when , no maximum is attained on the open parameter space, while the closed-space maximizer is zero. This extended estimate converges almost surely to , where . Finiteness follows from , and the limiting Poisson distribution follows from the finite-sum laws. In particular, the probability of a zero estimate tends to , proving failure of statistical consistency. The total Fisher information tends to : infinitely many observations need not provide infinite information.
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,
For ordered response categories, ordered thresholds and a common slope vector define this cumulative logistic regression. Increasing shifts probability toward higher categories. A covariate contrast multiplies all corresponding cumulative odds by the same factor. This model is not a canonical baseline-category multinomial logistic regression, so the latter's design-weighted count margins are not generally sufficient for it.
Complete separation means that a predictor direction strictly separates the binary outcomes as displayed. In logistic regression, replacing by increases each observed-outcome probability as increases, so the log-likelihood has no finite maximizer. Weak inequalities with some equalities can similarly produce quasi-complete separation. Finite coefficient estimates and ordinary information-matrix inference therefore require an existence check rather than relying only on the formal score equations.
For nonzero design entries the Bernoulli logistic-regression model has strictly concave log likelihood, since . A unique finite estimate exists exactly when its score is positive at minus infinity and negative at plus infinity. Perfect agreement of binary outcomes with the signs of the design can instead give a supremum approached at an infinite coefficient. If every design entry is zero, the coefficient is unidentifiable. Newton method uses the score divided by this observed information, with damping when needed.
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.
For ordered response categories, model each displayed conditional probability by a grouped-binomial logistic regression. The multinomial likelihood factors exactly into successive conditional binomial likelihoods, using the remaining category total as each stage's denominator. This is a different regression parameterization from baseline-category logits or cumulative odds. Separate cumulative binary indicators from the same person are dependent and cannot be treated as independent likelihood contributions.
For independent multinomial distributions with fixed stratum totals and baseline logits , the sufficient statistics are the displayed response-specific design-weighted counts, . Expanding the log-likelihood gives , plus a data-only term. The Fisher-Neyman factorization theorem therefore proves sufficiency; with an unrestricted identifiable canonical parameter, a likelihood-ratio argument proves minimal sufficiency. Factor indicators give the corresponding response/covariate margins.
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.
In a binary logistic regression, write the signed directional margin of observation as . Quasi-complete separation occurs when a nonzero direction makes all these margins nonnegative, with some zero and some strictly positive. Along coefficients , , each observation's log-likelihood contribution is nondecreasing, and those with positive margins strictly increase toward their limiting value. Hence the unpenalized fit cannot have a finite maximum in that direction. A group containing only outcome zeros is a simple example: sending its indicator coefficient to improves that group's likelihood while leaving all other observations unchanged. Zero fitted risk is then a boundary limit, and ordinary finite-coefficient Wald confidence intervals are unavailable.
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.
For independent with replicates per group and , , let and . The likelihood equations give , , and when . Boundary totals give infinite logits. With fixed and , the central limit theorem and delta method giveThe other groups do not increase information about the baseline logit when they have free offsets. For two groups, the information matrix for is with , whose inverse has first diagonal entry .
For each treatment year let be cycles, singleton deliveries, twin deliveries and deliveries of three or more babies. A singleton-per-cycle model uses . A multiple-delivery model conditional on a live delivery instead uses . The latter denominator counts deliveries, not babies, and it excludes failed cycles. Confusing these denominators changes the statistical question.
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 subject has a random intercept , with responses conditionally independent given and their covariates. Integrating the product of Bernoulli likelihoods over defines the joint subject likelihood and induces within-subject dependence. Its coefficients describe conditional odds ratios for a fixed latent subject effect. Under missing at random with distinct parameters, the observed-response likelihood integrates over the same random effect and sums out unobserved responses. Dependence of dropout on is not generally ignorable merely because conditional independence holds given .
Put and . Differentiation gives . Hence the displayed derivative lies between zero and one, strictly below one for a nondegenerate random intercept. A marginal logit is therefore generally nonlinear and its slope differs from the conditional slope even without confounding. This is a precise instance of noncollapsibility of the odds ratio.
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.
Articles were limited to the first 100 out of 111 total.
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\).