Section 2 · the math
The Method: First Principles
Every deliverable in this tool traces back to one idea: people reveal what they value by the trade-offs they make. This section builds that idea up — random utility, the logit, and the hierarchical Bayesian machinery — with the equations and the intuition side by side. Notation follows the standard reference, Ben-Akiva and Lerman’s Discrete Choice Analysis: Theory and Application to Travel Demand.1
1 · Random Utility Theory (RUT)
A respondent n facing alternative i derives some utility from it. We never observe utility directly, so we split it into a part we can model from the alternative’s attributes and a part we cannot:
- \(V_{ni}\)
- — the systematic utility: how much the attributes of \(i\) are worth to person \(n\).
- \(\mathbf{x}_{ni}\)
- — the design vector encoding alternative \(i\)’s attribute levels.
- \(\boldsymbol{\beta}_n\)
- — person \(n\)’s part-worth utilities: the weight they place on each level.
- \(\varepsilon_{ni}\)
- — everything we don’t observe (mood, context, unmeasured taste), treated as random.
Intuition: a choice is not deterministic. Two people looking at the same product can choose differently, and the same person can choose differently on two occasions. We model the tendency — the systematic part — and treat the rest as noise. The respondent is assumed to pick the alternative with the highest total utility \(U_{ni}\).
2 · Part-Worth Utilities and Coding
Each attribute (say, price, brand, size) contributes a part-worth for whichever level is present. Systematic utility is just their sum:
where \(a(i)\) is the level of attribute \(a\) shown in alternative \(i\). Categorical attributes are effects-coded so the part-worths within an attribute sum to zero — each level is then read as “better or worse than this attribute’s average.” Continuous attributes (often price) can instead enter linearly with a single slope. The tool lets you mark each attribute as categorical or continuous, because that choice changes both the design vector and how you read the result.
3 · From Utility to Choice: The Logit
To turn utilities into choice probabilities we need a distribution for the unobserved \(\varepsilon\). Assume the errors are i.i.d. Gumbel (Type-I extreme value). That single assumption yields the workhorse of the field, the multinomial logit (MNL):
Intuition: the probability of choosing an alternative is its “exponentiated attractiveness” divided by the total attractiveness of everything in the choice set \(C_n\). Add a more attractive option and every existing share shrinks proportionally. That proportionality is the famous independence of irrelevant alternatives (IIA) property — convenient, but a known limitation we relax later by letting \(\boldsymbol{\beta}_n\) vary across people (heterogeneity is what breaks aggregate IIA).
4 · The Three Study Types
The same backbone specializes to each design.
4.1 · Choice-Based Conjoint (CBC) → Hierarchical MNL
Respondents pick one alternative per task from a small set. The likelihood is exactly the MNL above, evaluated over every task \(t\) the respondent saw, with an optional None / NOTA alternative carrying its own alternative-specific constant \(\alpha_{\text{none}}\):
where \(c_{nt}\) is the alternative the respondent actually chose in task \(t\).
4.2 · MaxDiff → Best, and Best–Worst (Exploded) Logit
In MaxDiff a respondent sees a set of items and marks the best (and often the worst). Best choice is MNL over the shown set \(S\):
Worst is the same logic with the sign flipped — the worst item is the one with the lowest utility:
When both are recorded, the best–worst pair is modeled as a short exploded sequence: best is chosen from \(S\), then worst from the remaining items \(S \setminus \{i\}\). The tool uses best-only or best–worst likelihoods depending on what your data contain.
4.3 · Ranking Data → Exploded Logit
A full or partial ranking of \(J\) items decomposes into a sequence of independent MNL choices: pick the top item from all \(J\), then the top of the remaining \(J-1\), and so on. The probability of the whole ranking is the product:
where \((r)\) denotes the item ranked in position \(r\). This is the same engine that drives best–worst MaxDiff.
4.4 · Traditional (Ratings-Based) Conjoint → Hierarchical Linear
When respondents rate concepts (e.g., 1–9) rather than choose among them, the dependent variable is metric and there is no choice set, so the logit does not apply. Here the model is a linear regression of the rating on the design vector:
The part-worths \(\boldsymbol{\beta}_n\) are still individual-level, and they still come from the same population prior below — only the likelihood changes (Normal instead of categorical).
5 · Hierarchical Bayes: Borrowing Strength
Each respondent answers only a handful of tasks — far too few to pin down their personal part-worths in isolation. The hierarchical Bayesian (HB) model solves this by assuming everyone’s part-worths are drawn from a common population distribution, taken to be multivariate normal:
Intuition — semi-pooling. A respondent’s estimate is a compromise between their own noisy answers and the population mean \(\boldsymbol{\mu}\). Someone who answered consistently is trusted to look like themselves; someone with sparse or noisy data is pulled toward the crowd. This is the middle ground between two bad extremes: one model for everyone (ignores real differences) and a separate, unstable model per person (overfits). The covariance \(\boldsymbol{\Sigma}\) also learns how tastes co-move — e.g., people who love a premium brand also tolerating higher price.
We complete the model with weakly-informative hyperpriors (the modern PyMC parameterization, not inverse-Wishart):
The covariance is split into a correlation matrix \(\mathbf{\Omega}\) (LKJ prior) and per-parameter scales \(\mathbf{D}\) (half-normal), which samples far more reliably. The posterior is explored with MCMC — the No-U-Turn Sampler in PyMC — producing draws of every \(\boldsymbol{\beta}_n\), not point estimates, so all downstream numbers carry uncertainty.
price, when it should only ever hurt
If you have good reason to expect higher price to reduce appeal, you can force every respondent’s price effect to be \(\le 0\). The tool does this by reparameterizing the price term as \(\beta_{\text{price}} = -\exp(\theta)\) (or truncating its prior at zero), guaranteeing a monotone, sign-correct utility curve — which keeps the share simulator from rewarding a price increase.
6 · Trusting the Fit: Convergence and Holdout
Two checks stand between a fitted model and the deliverables that follow. The first asks whether the sampler that produced the estimates actually converged; the second asks whether those estimates predict choices the model never saw. Both appear at the top of Section 6: Results, and both should pass before any part-worth, share, or optimization is taken at face value.
Convergence Diagnostics
Hierarchical Bayes has no closed-form answer; the posterior is explored by running several Markov chains (MCMC) that wander the parameter space and, once warmed up, draw samples from it. Convergence diagnostics ask a simple question: did those chains actually settle on the same distribution, or are we reading numbers off a sampler that never stabilized?
R-hat (the Gelman–Rubin statistic) compares the variance between chains with the variance within each chain. If every chain is exploring the same region, the two variances agree and the ratio approaches 1:
Here \(W\) is the average within-chain variance and \(B\) the between-chain variance for a parameter. Values at or below 1.01 indicate the chains have mixed; values above it mean they disagree and the estimates are not yet reliable. ESS (effective sample size) then asks how much independent information those draws carry. Because consecutive MCMC draws are autocorrelated, a run of, say, 2,000 draws is worth far fewer independent ones:
where \(S\) is the total number of draws and \(\rho_t\) the autocorrelation at lag \(t\). A few hundred effective draws per parameter is enough to pin down posterior medians and credible intervals; the tool flags ESS below 400 as thin. What it means for the study: when R-hat is near 1.00 and ESS is in the hundreds, the part-worths, shares, and intervals downstream are trustworthy. If either misses, the fix is more tuning or more draws (occasionally a reparameterization) — not a reinterpretation of the numbers, which should be set aside until the sampler converges.
Holdout Validation
Convergence says the model fit itself consistently; it says nothing about whether the model captures real preference. A model can fit the data it was trained on and still fail on anything new (overfitting). Holdout validation guards against this by setting aside a slice of each respondent’s tasks before estimation, fitting on the rest, and then predicting the held-out tasks the model never saw.
For choice and MaxDiff data the headline is the hit rate — the share of held-out tasks whose actual winner the model ranks first — measured against the chance baseline a random guess would achieve given the number of alternatives \(J\) (roughly \(1/J\)). A hit rate comfortably above chance is direct evidence that the estimated utilities generalize to new decisions rather than memorizing the calibration tasks. For ratings-based conjoint the same split is scored with holdout R² — the fraction of variance in unseen ratings the model explains — and RMSE, the typical error on the rating scale:
What it means for the study: holdout accuracy is the closest thing to a generalization guarantee the method offers. Beating chance by a wide margin (or a clearly positive R²) means the part-worths reflect stable preference and the simulator and optimizer can be trusted to extrapolate to product configurations that were never shown. A hit rate only marginally above chance is a caution: the signal is real but weak, and predictions for novel concepts deserve wider error bars and more conservative reading.
7 · Designing the Experiment
Estimation quality is capped before a single interview is fielded: the design determines how much information the data can ever carry. For a candidate design \(D\) of choice sets \(s\) with effects-coded concept matrices \(\mathbf{X}_s\), the Fisher information under the multinomial logit of Section 3 is
$$ \mathcal{M}(D, \boldsymbol{\beta}) \;=\; \sum_{s} \mathbf{X}_s^{\top} \left(\operatorname{diag}(\mathbf{p}_s) - \mathbf{p}_s \mathbf{p}_s^{\top}\right) \mathbf{X}_s $$with \(\mathbf{p}_s\) the within-set choice probabilities. Section 5 minimizes the D-error \(\det(\mathcal{M})^{-1/p}\), where \(p\) is the number of model parameters — equivalently, it maximizes the volume of information the design buys per parameter. By default the probabilities are evaluated at \(\boldsymbol{\beta} = \mathbf{0}\) (the utility-neutral assumption, standard when no prior knowledge exists); supplying a point prior \(\boldsymbol{\beta}_0\) yields a locally D-optimal design instead.
The optimizer is a constrained coordinate exchange with multiple random restarts: it sweeps every cell of the design, trying each feasible level and keeping improvements. Prohibitions and conditional rules are enforced by never proposing an infeasible swap, so constraints cost nothing algorithmically — what they cost is information, and that is reported rather than hidden. One subtlety worth stating plainly: exact D-optimal designs concentrate on a few replicated, high-information tasks with unbalanced level use — correct by optimal-design theory, unusable in the field. The optimizer therefore works within the balanced, duplicate-free stratum: level counts are held inside quota bands and no task repeats within a version, which is where the classical orthogonal designs live when constraints permit them.
The headline diagnostic is relative D-efficiency: the constrained design’s information volume as a share of an unconstrained benchmark optimized in the same call, \(100 \cdot \left[\det(\mathcal{M}_{\mathrm{constrained}}) / \det(\mathcal{M}_{\mathrm{free}})\right]^{1/p}\). Its complement is the constraint cost shown in Section 5. Orthogonality is audited — level balance, pairwise co-occurrence, between-attribute design correlations — rather than promised, because under real client constraints the exact orthogonal array generally does not exist. When it does, the audits converge on it and say so.
8 · From Utilities to Deliverables
Attribute Importance
An attribute matters to the extent its best and worst levels are far apart. Per respondent, then averaged:
This is exactly the choice-drivers deliverable for CBC — computed directly from the HB utilities (a single, internally consistent model) rather than a separate aggregate fit.
Share of Preference (the Simulator)
For a hypothetical market of product configurations \(\{1,\dots,K\}\), each respondent’s choice probabilities are computed from their utilities and then averaged across the sample (and across posterior draws):
Averaging individual probabilities — not plugging in the mean respondent — is what lets the simulator escape aggregate IIA. The NOTA term appears only if a None option was in your data; \(\kappa\) is the calibration factor (\(\kappa>1\) raises the NOTA share, \(\kappa=1\) leaves it at the model estimate) you tune to move the NOTA share up or down for face validity.
Each retained posterior draw yields slightly different utilities, so the simulator evaluates the share once per draw and summarizes that distribution: the headline is the posterior median and the gray figures are the 5th–95th percentile (a 90% credible interval). Reporting a posterior quantile rather than the share evaluated at the mean utilities keeps the point estimate inside its own interval — the softmax is nonlinear, so the mean-utility share can otherwise fall just outside the band. Intervals appear only for hierarchical Bayes runs; the instant aggregate preview returns the point share alone.
Concept Optimization
The optimizer sweeps every configuration the design can express — all categorical levels crossed with a price grid — and ranks them by share, revenue, or profit, for the whole sample or a chosen segment. A concept’s share is the same quantity the simulator reports, scored against a benchmark: the None / NOTA option (standalone share of preference) or a fixed competitive set taken from the simulator. In both cases the per-respondent share is a binary logit,
where \(\sigma\) is the logistic function and the offset \(d_n\) is the log-denominator of the chosen benchmark (the competitive-set form folds in the NOTA term when a None option is present). Revenue is \(\text{share}\times\text{market}\times\text{price}\) and profit \(\text{share}\times\text{market}\times(\text{price}-\text{cost})\), so price re-orders the ranking away from raw share. The full grid is scored at the posterior mean for speed; the leaders on display carry the posterior-median share and its 90% band, consistent with the simulator, and can be loaded straight into it to test head-to-head.
MaxDiff Scores on One Scale
The default output is a probability-scaled score that sums to 100 across items — the most interpretable form for a non-technical reader:
Raw HB utilities and zero-centered interval scores are available as toggles. If you supply an anchor (for instance, a NOTA threshold), items are additionally reported as above or below the “worth having at all” line, turning a relative ranking into an absolute one.
The Three Use Cases, at a Glance
This is the menu you’ll choose from once you create an account.
Traditional Conjoint
Input: rated concepts (e.g. 1–9).
Model: HB linear regression.
Output: part-worth utilities and attribute importance —
exactly how much each feature, including each price point, moves a
concept’s value.
Choice-Based Conjoint
Input: chosen alternative per task (optional NOTA).
Model: HB multinomial logit.
Output: a market-share simulator, choice drivers, an
optimal configuration, and willingness-to-pay / revenue when price and cost
are supplied.
MaxDiff
Input: item sets with best (and optionally worst) picks.
Model: HB (exploded) logit.
Output: a single prioritized ranking of every item, plus
TURF / reach for choosing the best portfolio of items.
With the method in hand, the next step is to create an account and start a study.
Notes
- Moshe Ben-Akiva and Steven R. Lerman, Discrete Choice Analysis: Theory and Application to Travel Demand (Cambridge, MA: MIT Press, 1985). ↩