Variable colors Observed in data Parameters to estimate Set by the researcher

By this chapter, every model in the book has been laid out. But when you actually sit down to write a structural paper, what trips you up is usually not any single step of algebra; it is how to organize the whole enterprise, and which links you cannot afford to cut corners on. This chapter reduces everything that came before into a workflow you can follow and a set of tools you can reach for. The earlier chapters walked from logit to BLP and dynamic choice along $(F,G)$, saying which kind of question each class of model is best at answering; this chapter adds no new model and does just two closing things. The first half (9.1 and 9.2) strings these models into a working pipeline that runs from the research question to a finished paper: modeling, identification, estimation, validation, all the way through to the writing. The second half (9.3 through 9.7) organizes the core formulas, software, notation, and common failures from every chapter into quick-reference tables. When it is worth reaching for structure and how to walk the decision tree: the guiding rules were settled in Chapter 02 and the decision tree was given in Chapter 01, so this chapter does not repeat those arguments and simply carries the judgment through to concrete operations.

The illustrative example that runs through the chapter is still the book's standard video-subscription setup: a user chooses among general-interest platform A, general-interest platform B, niche documentary platform C, and not subscribing (the outside option, with utility normalized to 0). The parameters are $\beta_{\text{price}}=-0.1$, $\beta_{\text{ad}}=-0.05$, $\beta_{\text{content}}=0.8$, $\text{ASC}_C=0.3$, which give $V_A=-0.90$, $V_B=-1.11$, $V_C=-2.44$, and baseline choice probabilities of about $P_A=22.30\%$, $P_B=18.07\%$, $P_C=4.78\%$, $P_{\text{out}}=54.85\%$. illustrative data

9.1 Seven Steps from Research Question to Model

The most common way a structural paper fails is not an error in some step of the algebra; it is running the whole pipeline in the wrong order: first falling for an elegant model, then casting about for a question it can answer. That route almost never works, because a model is meant to serve the question, not the other way around. The right order is exactly the reverse, and we walk it here in seven steps. The first five are design and estimation; the sixth, validation, gets its own treatment in section 9.2; the seventh lands on the counterfactual and its presentation. Each step first says what to do, then flags where you are most likely to trip. Step 4, identification, is the most abstract and the easiest to get tangled in, so it comes with a template you can fill in and one worked-out example.

Write the counterfactual → Agent and choice set → Utility and heterogeneity → Identification argument → Estimation and diagnostics → Validation → Counterfactual and reporting

Step 1: Write down the counterfactual

Before you touch anything, write down in a sentence or two the counterfactual you want to evaluate, then ask yourself one question: does this really require a structural model? The rule was given in Chapter 02: if the counterfactual sits inside the range of variation the data have already seen (price did move within this interval, and you care only about the average effect within it), then design-based methods are usually more robust and less work. Only when the counterfactual steps outside the support of the data (a brand-new price point, a mechanism that never appeared, a market structure that has changed shape), or when the study itself calls for decomposing mechanisms or computing welfare numbers, does the extra cost of a full structural model pay for itself.

Pitfall: justifying it with “more sophisticated” or “I have an interesting counterfactual”

A structural method is never an end in itself. Before you use one, answer a question honestly: where exactly does the reduced form fall short, and what identification or policy payoff does the added structural complexity buy back? If you cannot answer that, do not rush to reach for structure. And many counterfactuals are only thought experiments on paper; the question worth pressing is who it matters to, and whether some decision-maker would actually act on it.

Step 2: Define the agent, the choice set, and the time granularity

To translate a still-fuzzy question into a model you can estimate, pin down three things: who is choosing (a consumer, a seller, or both sides), within which set the choice is made (does it include the outside option, is the consideration set smaller than the full set), and what the time unit of the decision is (each session, a monthly subscription cycle, or each purchase). The 12 modeling decisions in Chapter 02 are the complete list; here we give only a short checklist to get you started.

Short checklist (full version in Chapter 02, section 2.5)

Who is the decision-maker? Where is the boundary of the choice set drawn, and does it include the outside option? Do the time granularity and the data frequency line up? Is it a one-shot choice (static) or is there a switching cost or learning (dynamic, Chapter 07)? At which level does heterogeneity enter (none, observed interactions, random coefficients)? The distributional assumption $G$ determines the substitution pattern, so think it through before picking a model.

Pitfall: forcing estimation when the choice set is unobserved, or treating an endogenous state as an exogenous control

If there is no way to know which options the user actually saw (the exposure set of a recommendation algorithm is unobserved), a discrete choice model loses its footing; you should settle choice-set identification before talking about estimation (Chapter 08). Another hazard is treating “the result of past choices” as an exogenous control: cumulative usage and the current subscription tier are both products of earlier decisions, correlated with unobserved preferences, so you must either model the state's evolution explicitly (Chapter 07) or handle the initial-conditions problem.

Step 3: Specify utility and heterogeneity

Utility specifications line up on a ladder from simple to complex (Chapter 04): at the bottom is standard logit (no unobserved heterogeneity, bound by IIA), and above it, in order, nested logit (within-nest correlation), mixed logit (random coefficients), and latent class (discrete types). Every rung you climb needs its own justification: either an IIA test is rejected, or the substitution pattern is plainly implausible, or the research question itself calls for characterizing the distribution of preferences. Complexity is not free: it eats identifying power and compute, and it crowds out the time you could have spent on sensitivity analysis.

Pitfall: starting with the most complex model

The safe approach is to estimate a baseline logit first, get the coefficients and the fit, then add heterogeneity one rung at a time, comparing as you go. If the variance of a mixed logit's random coefficient comes back near 0, the data are telling you that the heterogeneity you assumed is not actually there. Falling back to a fixed coefficient is then both more honest and better identified.

Step 4: The identification argument

A word of reassurance first: identification is the most abstract stretch in the book, and finding it convoluted on a first pass is entirely normal, so we take it one step at a time. Estimating a set of coefficients is not the same as identifying them. Suppose an estimation returns a price coefficient of $\beta_{\text{price}}=-0.1$ with a large $t$ statistic, and you are ready to write “the price coefficient is significantly negative, identification done.” But a large $t$ value only says the number was estimated precisely; it does not answer a prior question: does this $-0.1$ measure the effect of price itself on choice, or has something else slipped in wearing price's clothing? Identification and precision are two different things, and identification comes first. Identification asks whether, even with infinite data, the variation in the data is enough to pick each parameter out from every competing explanation (Chapter 02, section 2.6).

Intuition: you cannot separate two things that always move together
Weigh two objects tied together on one scale and the scale reports only their combined weight; as long as the two are never separated, no number of weighings will split them apart. Identifying a price coefficient is often exactly this predicament. If plans with a higher monthly fee also tend to have better content, and part of that content (exclusive rights, reputation) lies outside the data, then “raising the price” always shows up alongside “higher quality” in the data. The regression will still compute a price coefficient, but it is the combined weight of price and quality, not price's own share. To split the two, you need variation that pushes price without disturbing quality.

To avoid missing hazards like this, break the identification argument into three interlocking questions and put each one, in turn, to every parameter you want to estimate:

An identification map in an applied paper is, at bottom, one row of answers to these three questions for each key parameter, assembled into a table. Let us fill in the price-coefficient row in full first.

A completed row: the price coefficient $\beta_{\text{price}}$ illustrative data
① What we are estimating

$\beta_{\text{price}}$ measures how much an option's utility falls for every one-yuan rise in the monthly fee. It directly supports the own-price elasticity: in the illustrative setup $\eta_{AA}=-2.33$, that is, a 1% increase in platform A's monthly fee lowers its share by about 2.33%. Every price-increase counterfactual that follows rests on this elasticity.

② Which variation identifies it

Different platforms in different periods charge different monthly fees while ads and ratings are broadly comparable; it is precisely this spread in price levels that identifies $\beta_{\text{price}}$. Picture the opposite extreme: if every platform charged exactly the same monthly fee, this column could not be filled in, the price coefficient would be beyond reach, and no sample size, however large, would help. This is exactly what it means to say identification has nothing to do with sample size.

③ When it fails, and how to fix it

The threat is that platforms with a higher monthly fee tend also to have higher unobserved quality $\xi_j$ (exclusive series that are not in the data). The price gap then has a quality gap mixed into it, the two are bundled together, $\beta_{\text{price}}$ is pushed toward zero, demand looks less sensitive than it truly is, and the naive approach of running logit directly on observed prices fails here. The remedy is to find an instrument that moves price without moving $\xi_j$ (a cost shifter or competitors' prices) and peel off the exogenous part of price; the ideal is a pricing experiment the platform ran itself (Chapters 06 and 08).

Going deeper: why contamination pushes the price coefficient toward zero

With price as the only regressor, it carries two opposing forces at once. A price increase lowers utility on its own, and that force is negative; but a price increase also comes with higher unobserved quality, which raises utility, and that force is positive. The two forces offset in estimation, the absolute value of the price coefficient is compressed and shrinks toward zero, and in severe cases even turns positive. The direction is definite: as long as $\text{Cov}(p_j,\xi_j)>0$, untreated endogeneity always makes demand look less sensitive than it truly is. This is the same mechanism by which the price coefficient is pushed toward zero in the OLS share regression of Chapter 06.

Apply this row's recipe to every key parameter and you get the ready-to-use template below. Its four columns line up exactly with the three questions just asked: the parameter is ①, “the variation it relies on” is ②, and “potential threat” plus “remedy” together are ③. Beyond the price coefficient from the illustrative setup, we fill one row each for a few parameters from the BLP setting.

Key parameterVariation it relies onPotential threatRemedy
$\beta_{\text{price}}$ price sensitivity Exogenous variation in price across markets/time Price correlated with unobserved quality $\xi_j$ Cost-shifter or competitor IV; better still, the platform's own pricing experiment (Chapters 06 and 08)
$\lambda_k$ nesting parameter Strength of within-nest substitution relative to across-nest substitution A misspecified nesting structure that places dissimilar options in one nest Report robustness under alternative nesting structures; constrain $\lambda_k\in(0,1]$ (Chapter 04)
$\sigma$ random-coefficient standard deviation Repeated choices by the same individual, or shares covarying with attributes Too short a panel or too few markets leaves $\sigma$ nearly unidentified Add draws and markets; use Halton sequences; run a parameter-recovery self-check first (Chapter 05)
$\text{ASC}$ / $\xi_j$ An option's fixed share level Collinear with attributes, so the level cannot be separated from the slope Normalize the outside option's utility to 0; initialize with the Berry inversion (Chapters 02 and 06)
Pitfall: hiding identification inside the functional form

The most insidious failure is when column ② should come up empty but the model quietly supplies the answer through its own functional form. If a parameter is “identified” purely by a distributional assumption or a nonlinearity, with no corresponding variation in the data behind it, then it was assumed into existence, not identified by the data. The exclusion restrictions in a structural model should face the same scrutiny as the instruments in an IV study, and should not be buried in a footnote (Chapter 02, section 2.6).

In one sentence: the job of the identification section is to answer these three questions in turn for every parameter you want to estimate; the row where column ② (which variation identifies it) cannot be filled in is the first place the whole paper will be breached.

Step 5: Estimation, diagnostics, and robustness

The estimation stage has two disciplines, one about convergence and one about robustness, and neither can be skipped.

The template for a robustness matrix follows; each row is a “change only one dimension” perturbation.

Perturbation dimensionBaseline specificationAlternative specificationWhat to watch
Distributional assumption $G$logitnested, probit, mixedStability of substitution patterns and welfare numbers
Nesting structureGroup by categoryGroup by price tier, by brand$\lambda_k$ and the sign of cross-elasticities
Number of simulation draws $R$$R=200$$R=500$, $R=1000$Whether simulation noise has been absorbed and estimates are stable
Instrument setCompetitor pricesCost-shifter IV, subset IVCoefficient drift, first-stage strength, Hansen J
SubsampleFull sampleSplit by market size, period, categoryCoefficient heterogeneity, whether the conclusion is driven by one slice
Pitfall: reporting robustness without using it as a diagnostic

A robustness table is not an optional routine listing; its value is as a diagnostic. If switching the distributional assumption changes elasticities several-fold, that says the conclusion actually rests on $G$; you should then chase the reason and judge which specification is more credible, rather than declaring the job done once two columns of numbers sit side by side.

Step 6: Validation

Even after estimation has converged and the robustness matrix is filled in, the model can still be wrong. Convergence only guarantees you found an extremum of the objective function, and robustness only says the conclusion does not capsize under small changes to the specification; neither answers a more fundamental question: can the model predict data it never saw during estimation? The step that answers precisely this question is validation. It is the core of a structural paper's credibility, and section 9.2 spells out how to do it.

Step 7: Counterfactual and reporting

Only at the final step do you actually produce the counterfactual and report the results clearly. Three judgments must be spelled out here: whether to re-solve the equilibrium (once a counterfactual changes firms' optimal prices or products, the supply side must re-equilibrate, Chapter 06); how to report uncertainty (a point estimate cannot be given bare; attach a confidence interval or standard error); and on what basis to compute welfare (the simple closed-form logsum comes from additive Type I extreme-value errors; under mixed logit you integrate the individual- or draw-conditional logsum a second time. Monetizing utility with a constant marginal utility of price also requires ignoring income effects or explicitly adopting the corresponding approximation. Report the $\Delta CS$ before and after the policy, not an absolute level that depends on the normalization of the utility origin).

Pitfall: a counterfactual that does not re-solve equilibrium, and welfare reported as an absolute level

Assuming that firms do not change prices, enter, or exit in the counterfactual is often more misleading than the reduced form. An equally common error is to report the absolute value of $CS$: it depends on the normalization of the outside option and has no economic meaning in itself; only the before-and-after difference $\Delta CS$ can be interpreted.

Writing it up: the four-part skeleton of the main text

Once the seven steps are done and the study is written up, the main text usually converges into four escalating parts: model, identification, estimation, counterfactual. The model part sets out the utility specification, the agent, the choice set, and the distributional assumption, that is, the five slots of $M(Y,X,\varepsilon;F,G)=0$; the identification part gives the identification map, explaining one by one the variation each key parameter relies on, the threats it faces, and the remedies; the estimation part reports the estimator, the convergence diagnostics, and the robustness matrix, after which validation carries enough weight that it usually becomes its own section covering all three layers (section 9.2); the counterfactual part presents the policy experiment, whether the equilibrium is re-solved, and the welfare basis and uncertainty intervals. These four parts roughly correspond to the seven steps above, except that validation is usually broken out of estimation into its own section. Write them all thoroughly and most methodological objections will be dissolved before the reader ever raises them.

To close 9.1, the table below gathers the methodological points most often pressed across the book's chapters into an index: each entry lists a one-sentence handling and the chapter where it lives, and it can serve as a pre-submission self-check, item by item, of whether the manuscript has already addressed each one.

Methodological pointHandling (one-sentence skeleton)See
The necessity of a structural methodWrite down a counterfactual that exceeds the variation in the data, falling under one of the three legitimate reasons: ex-ante evaluation, mechanism decomposition, welfare computation; then validate with a slice of experimental variation.Chapter 02
Does identification come from the data or the functional formGive an identification map, flag which conclusions are sensitive to the functional form, and report Monte Carlo recovery and robustness under alternative distributions.2.6, 9.1, 9.2
Handling IIAFirst judge whether IIA is really a problem in the specific application; if so, switch to nested or mixed, and report the Hausman-McFadden test and the substitution-pattern matrix.Chapters 02, 03, 04
Handling price endogeneityUse BLP's $\delta$ decomposition together with cost-shifter/competitor IV; report the first-stage F, the Hansen J, and IV-versus-non-IV coefficient comparisons.Chapter 06
Conditions for consumer surplus to holdThe logsum requires Type I extreme value and no income effects; report only $\Delta CS$, not the absolute level; under mixed logit it must be computed by simulation.Chapters 02, 08
Endogenous choice sets (personalized recommendation)Model the consideration set, or use platform randomization to fix the display set; acknowledge the scope of inference and run sensitivity to the choice-set definition.Chapter 08
Identifying network effects in two-sided marketsFind an exogenous shifter that affects only one side as an IV; note that platform fixed effects absorb the network-effect signal and drive a zero estimate.Chapter 08
The necessity of a dynamic modelAdopt one only when the research question involves forward-looking motives or switching costs and the static and dynamic models give different answers; it requires a long enough panel.Chapter 07
The credibility of a counterfactualConfirm that parameters are not extrapolated, that the supply side re-solves equilibrium, and report confidence intervals; ideally validate ex post with a held-out experimental arm.07, 9.2
Computing standard errorsUse the sandwich estimator for likelihood-based estimators and the GMM formula for GMM (BLP); cluster when there is within-market correlation.3.7, 6.6, 9.6
Bottom Line
The order of the seven steps is itself a discipline: start by writing down the counterfactual, then pass through agent and choice set, utility and heterogeneity, the identification argument, estimation and diagnostics, and validation, and land at last on presenting the counterfactual. Skip any step, especially the identification argument or validation, and a referee will supply it for the author.

9.2 A Model-Validation Playbook

A model that fits well is not the same as a model you can trust. However pretty the in-sample fit, it only says the model has enough degrees of freedom to hug the data in hand; it says nothing about how the model holds up on new data (see Chapter 02, section 2.8, for the related discussion). This section breaks validation into three escalating layers of operation, then discusses one approach unique to platform data, and finally gives a “what to do when validation fails” diagnostic tree.

Three layers of validation

Layer one, in-sample grouped fit. Do not fixate on the overall goodness of fit; line up predicted shares against observed shares cell by cell across subgroups. Walk through it with the video-subscription setup: simulate 6000 choice scenarios from the true parameters (monthly fee, ad minutes, and content rating all carry variation), estimate a correctly specified logit by MLE, and compare each option's average predicted share against its observed share. illustrative data

SubgroupObserved shareModel-predicted shareDifference (predicted − observed)
Platform A23.02%23.10%+0.08 pp
Platform B19.72%19.58%−0.14 pp
Platform C5.50%5.50%0.00 pp
Not subscribing (outside)51.77%51.82%+0.05 pp

A correctly specified model hugs every subgroup to within 0.14 percentage points. The converse does not hold: a good fit does not let you conclude the model is right, especially when you are only watching the totals. The counterexample below makes the point in full.

Hand the same data to a misspecified model that leaves out content rating. It shows no crack at all in the totals: platform C's overall share still lands near 5.5%, matching the observed value almost exactly. But slice the scenarios by content rating and the problem appears at once. In the scenarios where C's rating is higher, the actual share choosing C is 6.58% while the model gives only 5.52%, underpredicting by 1.06 percentage points; in the scenarios where C's rating is lower, the actual share is only 4.40% while the model reports 5.48%, overpredicting by 1.08 percentage points. illustrative data The root cause is that the misspecified model never wrote content rating into utility, so it cannot tell high-rating scenarios from low-rating ones and can only give the same prediction for all of them. The two directional biases, one positive and one negative, cancel exactly in the total, dressing up a long-misspecified model as a perfect fit.

Intuition: an aggregate fit provides cover for a wrong model
Picture a class where half the students score too high and half score too low, yet the average lands “right on target.” Look only at the average and you will never discover that both ends went wrong. The aggregate share is that average: it adds the overpredicted scenarios and the underpredicted ones together, positives and negatives cancel, and so even a wildly misspecified model can produce a total curve that matches the observed one exactly. What grouped fit does is nothing more than sort the students into score bands and look again, letting the systematic biases the average had covered up reveal themselves. So in validating a model, what carries information is never “are the totals right” but “which kind of scenario starts to miss.”

Layer two, out-of-sample holdout. Hold back part of the data during estimation, then have the model predict it afterward. How exactly you split depends on which kind of extrapolation you want to test:

Layer three, parameter-recovery Monte Carlo. Let the model simulate a batch of data from itself, then see whether the estimation routine can recover the true parameters intact. It cannot prove identification in real data, and it will not necessarily distinguish weak identification from a coding error; what it can test is whether, under the researcher's chosen DGP, sample design, and numerical tolerances, the whole estimation routine shows systematic bias, wrong standard errors, or an obvious numerical failure. The core logic fits in six lines, and it is really a single self-addressed question: I know the true answer, so does my routine compute its way back to it?

for b in 1..B:
    theta_true = fixed true parameters
    data_b     = simulate(model, theta_true, seed=b)   # generate data from the DGP
    theta_hat  = estimate(model, data_b)               # run the estimation routine
    record(theta_hat, se_hat)
# check: mean(theta_hat) ≈ theta_true (unbiased), and 95% interval coverage ≈ 95%
Worked example: parameter recovery for the video-subscription logit illustrative data
Setup

The true parameters are $\beta_{\text{price}}=-0.10$, $\beta_{\text{ad}}=-0.05$, $\beta_{\text{content}}=0.80$, $\text{ASC}_C=0.30$. Generate $N=6000$ choice scenarios; in each scenario the three platforms' monthly fee, ad minutes, and content rating carry a normal perturbation on top of their baseline values (to produce the variation needed to identify the slopes), and the outside option's utility is fixed at 0. Each individual adds an i.i.d. Type I extreme-value shock to every option and then chooses the option with the highest utility.

A single estimation

Run MLE on the simulated data, with standard errors from the inverse of the numerical Hessian. All four parameters land within one standard error of their true values:

ParameterTrue valueEstimateStandard error
$\beta_{\text{price}}$−0.100−0.09690.0036
$\beta_{\text{ad}}$−0.050−0.04910.0031
$\beta_{\text{content}}$0.8000.77030.0311
$\text{ASC}_C$0.3000.27670.0778
200 repetitions

The bias in a single estimation may be nothing but sampling fluctuation. Repeat the whole procedure 200 times and examine whether the mean of the estimates equals the true value and whether the 95% confidence interval's coverage is near 95%:

ParameterTrue valueMean over 200Bias95% coverage
$\beta_{\text{price}}$−0.100−0.0998+0.000296.0%
$\beta_{\text{ad}}$−0.050−0.0501−0.000195.0%
$\beta_{\text{content}}$0.8000.7990−0.001094.5%
$\text{ASC}_C$0.3000.2957−0.004394.0%
Reading it off

The Monte Carlo bias of all four parameters stays within 0.005, and coverage falls between 94% and 96%: under this one DGP, sample size, and number of repetitions, no obvious finite-sample bias or interval-coverage error shows up. This is not a proof of strict unbiasedness. If coverage systematically departs from 95%, check the standard-error formula, the optimization tolerance, the boundary parameters, and the model specification together; if the mean systematically departs from the true value, distinguish among finite-sample bias, weak identification, simulation error, and a coding error rather than pinning the cause on any one of them directly.

Platform data: using historical A/B tests as a holdout

The historical A/B tests a platform researcher has on hand are a rare, high-quality resource for validating a structural model. Randomization guarantees that the treatment and control groups share the same distribution, so you can use it this way: estimate the model on historical observational data (or the experiment's control group) alone, seal off an entire treatment arm, then predict the key metrics on that arm and compare against the experiment's measured values. Four points in particular:

A diagnostic tree after validation fails: locate the model component by the subgroup where the bias sits

When validation fails, do not rush to swap models. First locate which subgroup the bias falls in, then trace it back to which model component went wrong:

  • If the bias concentrates in a particular attribute dimension (say, options with high content ratings systematically deviate), check how that attribute enters utility: the functional form (linear or log), whether there is an interaction term, and whether the attribute was omitted (compare the content-rating misspecification example above).
  • If the bias concentrates in substitution among certain classes of options (shares flow in a counterintuitive way after one option is removed), IIA is most likely at work, and you need to upgrade to nested or mixed logit (Chapter 04).
  • If the bias concentrates in a particular price range or in high-priced options, usually price endogeneity was not fully treated, or a random price coefficient is needed (Chapters 04 and 06).
  • If the bias concentrates in a stretch of time (predictions worsen the later it gets), parameters are drifting, and you may need a dynamic model or to allow time heterogeneity (Chapter 07).
  • If the bias is uniform across the board and in one direction, it is often a definitional problem with the outside-option share or the market size, and you should return to the data-preparation stage.
Bottom Line
None of the three layers of validation can be skipped: grouped fit guards against “the totals match while the subgroups miss,” out-of-sample holdout tests the license to extrapolate, and parameter-recovery Monte Carlo exposes non-identification and coding errors. The A/B tests a platform runs almost constantly are a ready-made, high-quality holdout, and should be folded into the validation workflow.

9.3 Formula Quick Reference

The formulas are organized by model, one small table per block. They match the main text of each chapter. See section 9.5 for an index of the notation.

Expressiveness / flexibility ↑ Relax assumptions rung by rung · compute and identification cost ↑ → MNL Baseline · IIA · homog. · static Chapter 03 Nested / Mixed Relax IIA · heterogeneity Chapter 04 BLP Relax price exog. · shares Chapter 06 Dynamic discrete choice Relax static · forward-looking Chapter 07
Figure 9.1The book's method ladder. Starting from the simplest model, MNL, each rung up relaxes one assumption: Nested and Mixed break IIA and accommodate preference heterogeneity (Chapter 04); BLP goes further and relaxes price exogeneity, treating the case where only aggregate shares are observed (Chapter 06); dynamic discrete choice relaxes the static assumption and adds forward-looking behavior back in (Chapter 07). Expressiveness grows with each rung up, and the identification and computation costs rise along with it. The simulation methods of Chapter 05 are the engine of this ladder, making mixed logit and BLP, which have no closed-form solution, computable.
Notation conventions (two coexist, take care not to mix them)

The Logit/Nested/Mixed blocks follow the convention of the main text in Chapters 02 through 05: $V_{nj}=\beta'x_{nj}$, the price coefficient $\beta_{\text{price}}<0$ enters utility directly, and the marginal utility of income is written $\alpha\equiv-\beta_{\text{price}}>0$. The BLP block follows the convention of Chapter 06: $\delta=x_j'\bar\beta-\bar\alpha p_j+\xi_j$, where $\bar\alpha>0$ denotes the magnitude of the price disutility. Under both conventions, the own-price elasticity is negative and the cross-price elasticity is positive.

Logit illustrative data

QuantityFormulaNotes
Choice probability$P_{nj}=\dfrac{e^{V_{nj}}}{\sum_{k}e^{V_{nk}}}$with the outside option's $V_{n0}=0$, the denominator contains a term $e^{0}=1$
Own-price elasticity$\eta_{jj}=\beta_{\text{price}}\,p_j\,(1-P_j)$$<0$; in the illustration $\eta_{AA}=-2.33$
Cross-price elasticity$\eta_{jk}=-\beta_{\text{price}}\,p_k\,P_k$$>0$, and independent of $j$ (a fingerprint of IIA); in the illustration $\eta_{B,p_A}=0.669$
logsum consumer surplus$E[CS_n]=\dfrac{1}{\alpha}\ln\!\big(\sum_{k}e^{V_{nk}}\big)+C$$\alpha=-\beta_{\text{price}}$; the quantity after taking the expectation over $\varepsilon$; this holds only under Type I extreme value and no income effects ($\alpha$ treated as constant), and with income effects use the compensating variation instead (Chapter 08); only $\Delta CS$ is interpretable (Williams 1977; Small & Rosen 1981)
Log-likelihood$LL=\sum_n\sum_j y_{nj}\ln P_{nj}$$y_{nj}=1$ when $n$ chooses $j$
IIA property$\dfrac{P_{ni}}{P_{nj}}=\dfrac{e^{V_{ni}}}{e^{V_{nj}}}$the ratio is independent of any third option, the hallmark of logit and also its limitation

Nested Logit

QuantityFormulaNotes
Within-nest conditional probability$P_{n j\mid B_k}=\dfrac{e^{V_{nj}/\lambda_k}}{\sum_{i\in B_k}e^{V_{ni}/\lambda_k}}$$j\in B_k$
inclusive value$I_{nk}=\ln\sum_{i\in B_k}e^{V_{ni}/\lambda_k}$the “bundled utility” of nest $k$
Marginal probability of choosing a nest$P_{n B_k}=\dfrac{e^{\lambda_k I_{nk}}}{\sum_{l}e^{\lambda_l I_{nl}}}$
Joint probability$P_{nj}=P_{n j\mid B_k}\cdot P_{n B_k}$choose the nest first, then within the nest
$\lambda$ constraint$\lambda_k\in(0,1]$within-nest correlation strengthens as $\lambda_k$ decreases ($1-\lambda_k$ is often used as a directional gauge); $\lambda_k=1$ collapses to logit

Mixed Logit

QuantityFormulaNotes
Mixed probability (integral definition)$P_{nj}=\displaystyle\int \frac{e^{V_{nj}(\beta)}}{\sum_k e^{V_{nk}(\beta)}}\,f(\beta\mid\theta)\,d\beta$integrated over the distribution of the random coefficient $\beta$, generally without a closed form
Simulated probability$\hat P_{nj}=\dfrac{1}{R}\sum_{r=1}^{R} L_{nj}(\beta^{(r)})$$\beta^{(r)}$ drawn from $f(\cdot\mid\theta)$; start with $R$ from 500 to 1000, use Halton, and report doubling robustness
Panel joint probability$\hat P_{n}=\dfrac{1}{R}\sum_{r=1}^{R}\prod_{t}L_{n y_{nt}}(\beta^{(r)})$the same individual's $\beta^r$ is shared across periods, jointly identifying heterogeneity
Simulated log-likelihood$SLL=\sum_n\ln\hat P_{n,y_n}$the objective function after replacing the integral with the simulated probability

BLP

QuantityFormulaNotes
Utility decomposition$\delta_{jm}=x_{jm}'\bar\beta-\bar\alpha p_{jm}+\xi_{jm}$$\delta$ is the mean utility, $\xi$ is unobserved quality
Contraction mapping (inner loop)$\delta^{t+1}=\delta^{t}+\ln S_{jm}-\ln\hat S_{jm}(\delta^{t})$$S$ is the observed share, $\hat S$ the predicted share; initialize from the Berry inversion
Berry inversion (logit case)$\ln S_{jm}-\ln S_{0m}=\delta_{jm}$under homogeneous logit, shares are linear in $\delta$, the first step of estimation
Moment condition$\mathbb{E}[\xi_{jm}\,Z_{jm}]=0$the instruments are orthogonal to unobserved quality
GMM objective$\hat\theta=\arg\min_\theta\ \xi(\theta)'ZWZ'\xi(\theta)$$W$ is the weighting matrix; when overidentified, use the two-step optimal weight

Dynamic discrete choice (Type I extreme-value case)

QuantityFormulaNotes
Bellman equation$V(x,\varepsilon)=\displaystyle\max_d\big\{u(x,d)+\varepsilon_d+\beta\,\mathbb{E}[V(x',\varepsilon')\mid x,d]\big\}$here $\beta$ is the discount factor (the Chapter 07 convention), and the utility parameters are written $\theta$, not the preference vector used elsewhere in this table
Choice-specific value$v_d(x)=u(x,d)+\beta\,\mathbb{E}[\bar V(x')\mid x,d]$the part that excludes the current shock $\varepsilon_d$
Expected value (logsum form)$\bar V(x)=\ln\sum_d e^{v_d(x)}+\gamma$$\gamma$ is Euler's constant; $\bar V$ is the integrated value function (the ex-ante value), equal to the logsum plus $\gamma$
Choice probability$P(d\mid x)=\dfrac{e^{v_d(x)}}{\sum_{d'}e^{v_{d'}(x)}}$the same structure as static logit, only with utility replaced by value
CCP inversion (Hotz-Miller)$\bar V(x)-v_d(x)=\gamma-\ln P(d\mid x)$recover the value difference directly from observed CCPs, avoiding repeated Bellman solves; equivalent to the differenced form of Chapter 07, $v_d-v_0=\ln P(d\mid x)-\ln P(0\mid x)$

9.4 Software Reference

The table below is organized by task rather than by software. The first principle in choosing a package is ecosystem consistency over single-point functionality: keeping estimation, counterfactuals, and plotting in one language is safer and less error-prone than shuttling data across three languages for one particular feature.

TaskPythonRStata
Conditional/multinomial logitxlogit, pylogitmlogitclogit, asclogit, cmclogit
Nested logitpylogitmlogit, apollonlogit
Mixed logitxlogit, pylogitmlogit, apollo, gmnl, mixlmixlogit, cmmixlogit
BLPpyblpBLPestimatoRNo mature package; usually hand-coded
Dynamic discrete choiceUsually hand-codedUsually hand-codedUsually hand-coded
Welfare/consumer surplusHand-coded (or pyblp built-in)Hand-codedHand-coded

The division of labor among the three Python packages needs to be kept straight: xlogit focuses on multinomial and mixed logit, uses GPU acceleration, and is far faster than traditional implementations on large samples, but it does not implement nested logit; when you need nested, switch to pylogit within Python. pyblp is the de facto standard for differentiated-products demand estimation, with built-in methods for both counterfactuals and elasticities. Dynamic models still have few off-the-shelf packages, and the state space and value-function iteration usually have to be implemented yourself.

PyBLP: the most common calls

import pyblp, numpy as np
problem = pyblp.Problem(
    product_formulations=(
        pyblp.Formulation('0 + prices + x1 + x2', absorb='C(product_ids)'),  # linear part (absorb product fixed effects, drop the intercept to avoid collinearity)
        pyblp.Formulation('0 + prices + x1')),                                # random-coefficient part
    product_data=product_data,          # must contain market_ids, shares, prices, and instrument columns
    integration=pyblp.Integration('product', size=5))  # random coefficients require an integration config (or pass agent_data instead)
results = problem.solve(
    sigma=np.eye(2) * 0.5,              # initial values for the random coefficients
    optimization=pyblp.Optimization('l-bfgs-b', {'gtol': 1e-5}),
    iteration=pyblp.Iteration('squarem', {'atol': 1e-14}))   # inner-loop contraction
elast = results.compute_elasticities() # elasticity matrix
cs    = results.compute_consumer_surpluses()                 # consumer surplus

xlogit: the most common calls (mixed logit)

from xlogit import MixedLogit
model = MixedLogit()
model.fit(
    X=df[['price', 'ad', 'content']],   # long-format design matrix
    y=df['choice'],
    varnames=['price', 'ad', 'content'],
    alts=df['alt'], ids=df['chid'],     # option and choice-situation indices
    randvars={'price': 'n', 'content': 'n'},  # monthly fee and content rating as normal random coefficients
    n_draws=500, halton=True)           # Halton draws
model.summary()

9.5 Notation

Notation used throughout the book. Local special usages are noted in place in each chapter.

SymbolMeaningType
$n$Index of the decision-maker (consumer)Index
$j,\ i$Index of options/alternativesIndex
$m,\ t$Market/time indexIndex
$U_{nj}$Total utility $=V_{nj}+\varepsilon_{nj}$Utility
$V_{nj}$Deterministic (systematic) utilityObserved part
$\varepsilon_{nj}$Random utility shock (Type I extreme value for logit)Unobserved random
$\beta$Vector of preference parametersTo estimate
$\beta$Discount factor (a local usage in the Chapter 07 dynamic model, usually fixed rather than estimated)Set by the researcher
$\alpha$Price-related coefficient: under the BLP convention $\bar\alpha>0$ is the magnitude of the price disutility; under the logit convention $\alpha=-\beta_{\text{price}}$ is the marginal utility of incomeTo estimate
$p_j$Price of option $j$Observed
$x_j$Vector of observed attributes of option $j$Observed
$\xi_j$Unobserved product quality (BLP)Unobserved
$\delta_{jm}$Mean utility (BLP)To estimate
$\mu_{ijm}$Individual deviation from the mean utility, generated by $\theta_2$ and random draws (a constructed quantity, not a free parameter)Constructed quantity
$\lambda_k$Nest dissimilarity parameter (the smaller $\lambda_k$, the more similar within the nest), $\in(0,1]$To estimate
$\theta_1,\ \theta_2$Linear parameters $\theta_1=(\bar\beta,\bar\alpha)$ / nonlinear parameters $\theta_2=(\Pi,\Sigma)$To estimate
$\Sigma$Covariance (standard deviations) of the random coefficients, taste heterogeneity beyond demographics (BLP)To estimate
$\Pi$How tastes vary with observed demographics (BLP)To estimate
$\sigma_k$Standard deviation of the $k$-th random coefficient (the scale of heterogeneity)To estimate
$D_i$Consumer demographics (income, age, and so on), the observed input to BLP simulationObserved
$\nu_i$Standard-normal random taste draws, drawn independently for each consumer in simulationSet by the researcher
$P_{nj}$Probability that individual $n$ chooses $j$Choice probability
$S_{jm}$$,\ \hat S_{jm}$Observed and predicted shares of option $j$ in market $m$ (BLP)Share (aggregate)
$Z$Matrix of instrumentsObserved
$W$GMM weighting matrix (set by the researcher in the first step, with the optimal weight estimated from residuals in the second)Set by the researcher / estimated from data
$\gamma$Euler's constant $\approx 0.5772$, the location correction of the logsum (derived from Type I extreme value)Constant
$R$Number of simulation drawsSet by the researcher
$CS$Consumer surplusWelfare

9.6 Troubleshooting Guide

Below are the four most common symptoms, each laid out in three parts: possible causes, checks, and fixes. This material comes from estimation practice and pairs with the diagnostic discipline of Step 5 in section 9.1.

Symptom 1: the optimizer does not converge

Symptom 2: standard errors blow up

Symptom 3: elasticity signs or magnitudes look wrong

Symptom 4: predicted shares differ widely from actual

9.7 Common Pitfalls

This section collects pitfalls at the workflow level; the technical pitfalls internal to each chapter appear in that chapter's three-part set. This table plays a distinct role from the two components before it: 9.1 flags the trap at each step in place and its closing index table serves as an item-by-item pre-submission self-check, while this table starts from consequences, spelling out what each kind of pitfall costs once you commit it.

PitfallWhy it's wrongWhat to do instead
Estimate the model first, think about the research question later The model exists to serve the counterfactual; reversing the order yields an elegant estimate whose answer no one needs Write the counterfactual first, judge whether structure is worth it, then pick the model (Step 1 of 9.1)
Report robustness without using it as a diagnostic Listing columns side by side without interpretation is as good as no robustness at all; the conclusion may hang on an unexamined assumption and flip under a different specification Read out of the robustness matrix “which conclusion rests on which assumption” (Step 5 of 9.1)
Treat in-sample fit as validation Enough degrees of freedom will hug the data; and an aggregate fit hides systematic bias in the subgroups Do all three layers: grouped fit, out-of-sample holdout, and parameter recovery (section 9.2)
A counterfactual that does not re-solve equilibrium Prices or products change with the policy; a counterfactual that fixes them can be more misleading than the reduced form Any counterfactual that changes firms' optimal behavior must re-equilibrate the supply side (Step 7 of 9.1)
Cite numbers from real papers without checking the source Numbers are easily distorted in paraphrase, and one wrong number can shake the credibility of a whole argument For numbers you are unsure of, write only a qualitative conclusion; to state a specific number, go back to the source and check
Run code without setting a random seed Simulation-based estimates (MSL, bootstrap, Monte Carlo) become irreproducible, and others cannot recheck them Fix the seed at every random step; parameter recovery and counterfactuals should both recompute with one click (section 9.2)

9.8 Chapter Summary

This chapter reduces the book from a box of tools into a single workflow. From choices to counterfactuals, the full chain runs like this: first write down the counterfactual that exceeds the variation in the data and weigh whether it is worth reaching for a structural model (Chapter 02); translate it into an agent, a choice set, and a utility specification, and derive choice probabilities along RUM plus a distributional assumption (Chapter 03); relax IIA as the substitution pattern requires (Chapter 04); handle the integrals with no closed form by simulation (Chapter 05); correct price endogeneity with instruments and BLP (Chapter 06); extend to a dynamic model when forward-looking motives arise (Chapter 07); and put these tools back into the platform setting (Chapter 08); then write the identification map, run convergence and robustness diagnostics, complete all three layers of validation, and finally re-solve the equilibrium, compute welfare with intervals attached, and report it faithfully. The order of these seven steps is itself the operationalization of this chain.

Finally, we should honestly mark the boundary. What a structural model can do for you is this: in an environment never observed, make grounded, checkable predictions, pull mechanisms apart, work out welfare, and lay out plainly the assumptions the extrapolation rests on, for others to argue with. What it cannot do for you is guarantee that the distributional assumption is true, make endogeneity vanish into thin air, or hold up when extrapolated to another population or another era. Two sentences are worth committing to memory: passing parameter recovery only says the code estimates correctly under the given DGP, not that the model specification is true; a good fit only shows that the degrees of freedom are sufficient, not that the conclusion is credible. The value of structural estimation has never rested on the label of the method, but on whether you can spell out the identification of every primitive and leave others a handle by which to falsify it. Do this solidly and the road from choices to counterfactuals truly goes through.

Further Reading

Structural modeling practice and methodology

Demand estimation and BLP practice

Welfare, dynamics, and validation

Textbooks