Why Estimation Requires Care
A nested logit model is useful when alternatives can be grouped into nests with related unobserved utility components. Its probabilities combine two decisions: which nest is chosen and which alternative is chosen within that nest. Estimation must respect this structure. In particular, the model’s utility scale must be normalized, and its nest parameters must satisfy restrictions that give the probabilities a random-utility interpretation.
The task here is to estimate alternative-specific utility coefficients and the nest parameters from observed choices. The central calculation is maximum likelihood: choose parameter values that assign high probability to the choices actually observed. The earlier material on nested-logit probabilities and scale parameters supplies the probability structure; the focus here is how to turn it into an estimable likelihood and how to quantify uncertainty afterward.
Model, Normalization, and Parameter Restrictions
Suppose there are \(n\) independent choice occasions, alternatives indexed by \(j\), and nests indexed by \(m\). Let \(C_m\) be the set of alternatives in nest \(m\), with each available alternative belonging to exactly one nest. On occasion \(i\), write the systematic utility of alternative \(j\) as \(V_{ij}=x_{ij}'\beta\), where \(x_{ij}\) contains observed alternative-specific attributes and \(\beta\) contains their coefficients. Let \(Z_{im}=q_{im}'\gamma\) be the systematic component at the nest level. The model’s top-level utility scale is normalized to one.
For a random-utility-consistent nested logit, each estimable dissimilarity parameter satisfies \(0<\lambda_m\leq 1\). The value one removes the within-nest scale distinction for that nest; values below one permit the modeled dependence among alternatives in the same nest. A singleton nest has a within-nest probability of one and inclusive value equal to its alternative’s systematic utility divided by its \(\lambda_m\). Its \(\lambda_m\) cannot be separately identified from that singleton’s contribution in the same way as a multi-alternative nest parameter, so it is normally fixed rather than estimated.
Normalization is needed because adding the same constant to every alternative’s utility on an occasion leaves all choice probabilities unchanged. In practice, one alternative-specific constant is omitted or fixed as a reference, and any redundant nest-level constants are also normalized or excluded. The remaining design must have enough independent variation to identify the coefficients: for example, a variable that is constant across every alternative on every occasion cannot identify a relative utility coefficient. These are identification requirements, not numerical conveniences.
From Choice Probabilities to the Likelihood
Let \(y_i\) denote the alternative chosen on occasion \(i\), and let \(m(y_i)\) be its nest. Under independent choice occasions, the likelihood is the product of the probabilities assigned to the observed choices. Taking logs turns that product into a sum. The contribution from an observed alternative \(j\in C_m\) can also be written in a form useful for computation:
This expression follows by taking the log of \(P_{im}P_{ij\mid m}\). The within-nest log probability is \(V_{ij}/\lambda_m-I_{im}\), while the nest log probability is \(Z_{im}+\lambda_m I_{im}-\log\sum_r\exp(Z_{ir}+\lambda_r I_{ir})\). Adding these terms gives the displayed result. The sample log-likelihood is therefore
Maximum-likelihood estimation chooses the admissible parameter vector that maximizes this function. Equivalently, software can minimize its negative. Because probabilities involve exponentials, implementations commonly evaluate log-sums with a numerically stable log-sum-exp calculation rather than exponentiating very large values directly.
Worked Example: Computing One Nested-Logit Likelihood Contribution
Consider a hypothetical choice among car, bus, and rail. Bus and rail form a transit nest, with \(\lambda_{\text{transit}}=0.7\); car is a singleton nest. Set all nest-level utilities to zero. For this choice occasion, let \(V_{\text{bus}}=0.2\), \(V_{\text{rail}}=0.5\), and \(V_{\text{car}}=0\). These are candidate parameter-implied utilities, not estimates from a real study.
For transit, the inclusive value is \(I_{\text{transit}}=\log[\exp(0.2/0.7)+\exp(0.5/0.7)]\). The exponentials are approximately \(1.3307\) and \(2.0427\), so \(I_{\text{transit}}=\log(3.3734)\approx1.2159\). The conditional probabilities are \(P_{\text{bus}\mid\text{transit}}=1.3307/3.3734\approx0.3945\) and \(P_{\text{rail}\mid\text{transit}}=2.0427/3.3734\approx0.6055\).
The transit-nest index is \(0.7(1.2159)=0.8511\), while the car-nest index is zero. Thus \(P_{\text{transit}}=\exp(0.8511)/[\exp(0.8511)+1]\approx0.7008\), and \(P_{\text{car}}\approx0.2992\). Multiplying the nest probability by the conditional probabilities gives \(P_{\text{rail}}\approx0.7008(0.6055)=0.4244\) and \(P_{\text{bus}}\approx0.7008(0.3945)=0.2764\). The three overall probabilities sum to approximately one.
If rail is observed, this occasion’s log-likelihood contribution is \(\log(0.4244)\approx-0.8572\). If a hypothetical four-occasion sample has observed choices rail, rail, bus, and car, and the same candidate probabilities apply on each occasion, its log-likelihood is \(2\log(0.4244)+\log(0.2764)+\log(0.2992)\approx-4.207\). The likelihood uses the probability of each observed alternative, not the probability of its nest alone.
Numerical Maximization and Constraints
The likelihood is generally nonlinear in both the utility coefficients and the nest parameters. A numerical optimizer evaluates the log-likelihood repeatedly, moving the parameters to increase it until it reaches a maximum or a stopping criterion. Reliable estimation requires checking that the reported solution is admissible and that the optimizer has actually converged.
One way to enforce \(0<\lambda_m<1\) during optimization is to use an unconstrained parameter \(\eta_m\) and set \(\lambda_m=1/(1+\exp(-\eta_m))\). This transformation guarantees an interior value. Since it cannot attain \(\lambda_m=1\) at a finite \(\eta_m\), a model that permits the boundary should also evaluate or constrain that boundary explicitly. Alternatively, a constrained optimizer can impose \(0<\lambda_m\leq1\) directly. In either approach, starting values, convergence messages, and the final constraint values should be inspected.
List the available alternatives and their nests for each occasion, and define the observed utility and nest-level covariates.
Choose reference constants and remove redundant terms; verify that the covariates vary in ways that can distinguish the parameters.
Compute inclusive values, nest probabilities, within-nest probabilities, and the log probability of each observed choice.
Optimize the log-likelihood with the required scale normalization and valid bounds on the estimable nest parameters.
Check convergence and constraints, then calculate standard errors and use inference appropriate to interior or boundary estimates.
Worked Example: Reading a Hypothetical Nested-Logit Fit
Suppose a hypothetical data set contains 600 choice occasions, each with car, bus, and rail available. Bus and rail share a transit nest. The fitted utility specification is \(V_{ij}=\alpha_j+\beta_{\text{fare}}\text{fare}_{ij}\), with car as the reference alternative, and the nest-level systematic utilities are set to zero. A numerical maximization of the full data’s likelihood is stipulated to return \(\hat{\alpha}_{\text{bus}}=-0.30\), \(\hat{\alpha}_{\text{rail}}=0.15\), \(\hat{\beta}_{\text{fare}}=-0.42\), and \(\hat{\lambda}_{\text{transit}}=0.68\), with maximized log-likelihood \(-527.64\). These are illustrative hypothetical software results; the choice counts alone would not be enough to reproduce them.
The fare coefficient is measured in utility units per fare unit. Its negative sign means that, holding the other included terms fixed, a higher fare lowers the systematic utility of an alternative by \(0.42\) utility units per fare unit. It is not itself a percentage change in choice probability. The bus and rail constants are relative to the omitted car constant. The estimated transit parameter is inside the admissible interval, so it satisfies the stated numerical restriction.
For a maximum rather than a numerical failure, the optimizer should report convergence, and the log-likelihood should not improve under reasonable alternative starting values. The estimates should also be checked for implausible magnitudes, near-collinearity, and proximity to a constraint. These checks help determine whether reported standard errors and subsequent inference are trustworthy.
Inference for Estimated Parameters
When the maximum is an interior point and the model is correctly specified with independent choice occasions, the usual large-sample maximum-likelihood approximation treats the estimator as approximately normal around the true parameter. The estimated covariance matrix is commonly obtained from the inverse of the observed information, the negative Hessian of the log-likelihood evaluated at the estimates. A robust sandwich covariance estimator can be used when the likelihood’s variance assumptions need protection, subject to the relevant sampling structure.
For a scalar parameter \(\theta\), a standard error is the square root of its estimated variance. An approximate two-sided \(100(1-\alpha)\%\) confidence interval is \(\hat{\theta}\pm z_{1-\alpha/2}SE(\hat{\theta})\), where \(z_{1-\alpha/2}\) is the standard-normal quantile. A Wald test of \(H_0:\theta=\theta_0\) uses \(z=(\hat{\theta}-\theta_0)/SE(\hat{\theta})\). These approximations are most defensible when the estimate is well inside its parameter space and the likelihood is locally regular.
Worked Example: Confidence Interval and a Coefficient Test
Continue with the hypothetical fitted model above. Suppose its estimated standard error for the fare coefficient is \(0.10\). A 95% Wald confidence interval is \(\hat{\beta}_{\text{fare}}\pm1.96SE(\hat{\beta}_{\text{fare}})=-0.42\pm1.96(0.10)\). Since \(1.96(0.10)=0.196\), the interval is approximately \((-0.616,-0.224)\) utility units per fare unit.
To test \(H_0:\beta_{\text{fare}}=0\) against a two-sided alternative, the statistic is \(z=(-0.42-0)/0.10=-4.20\), giving a two-sided \(p\)-value below \(0.001\). Under the model and the usual inference approximation, this is strong evidence that the fare coefficient differs from zero. The interval describes uncertainty about the utility coefficient, not a direct interval for a change in choice probability.
Suppose also that the estimated standard error for \(\lambda_{\text{transit}}\) is \(0.11\). The corresponding simple Wald interval is \(0.68\pm1.96(0.11)=(0.464,0.896)\). It lies inside the admissible range, but a Wald interval is only an approximation; profile-likelihood or other constrained inference may be preferable when an estimate is close to a boundary.
Why Boundary Inference Is Different
The restriction \(\lambda_m\leq1\) has inferential consequences. If an estimate is near one, a symmetric normal approximation can extend beyond the parameter space, and the likelihood may be asymmetric. In particular, a routine Wald test of \(H_0:\lambda_m=1\) does not generally have its usual interior-parameter reference distribution, because the null lies on the boundary. Boundary tests require appropriate likelihood-based theory or a suitable constrained procedure; simply applying the ordinary two-sided \(z\)-test can give an incorrect reference distribution.
For an interior estimate, transformed-parameter inference also needs care. If the optimizer estimates \(\eta_m\) and reports \(\hat{\lambda}_m=1/(1+\exp(-\hat{\eta}_m))\), the approximate standard error on the \(\lambda_m\) scale can be calculated by the delta method using derivative \(\lambda_m(1-\lambda_m)\). An interval formed on the \(\eta_m\) scale and then transformed may better respect the parameter range than a symmetric interval on the \(\lambda_m\) scale.
A carefully estimated nested logit model is more than a choice of optimizer. It requires a coherent choice tree, identified and normalized utilities, a likelihood based on the observed alternatives, and numerical handling of the admissible nest-parameter range. Inference then depends on both the local curvature of the likelihood and whether the estimate is interior or on a constraint. Keeping these pieces distinct prevents a plausible-looking output table from being mistaken for a fully checked model.
Check Your Understanding
Use the definitions and estimation logic in this tutorial to answer the following questions.
- Why does the nested-logit likelihood use the product of the nest probability and the within-nest probability for the observed alternative?
- What utility normalization is needed, and why can a covariate with no relative variation across alternatives fail to identify a coefficient?
- Why should a singleton nest’s dissimilarity parameter generally not be estimated from its within-nest choice probability?
- Give one numerical strategy for ensuring that an estimated dissimilarity parameter remains in its admissible range, and explain how it handles the value one.
- Why can a routine Wald test be unreliable when a nest parameter estimate is at its upper boundary?