maxdiff#

MaxDiff (Best-Worst Scaling) hierarchical Bayesian model.

Implements the Louviere sequential best-worst model:

P(best, worst | subset) = P(best | subset) * P(worst | subset \ {best})

where the worst pick uses sign-flipped utilities. Item-level utilities are estimated with optional per-respondent random intercepts (hierarchical / HB-MaxDiff). The reference item’s utility is pinned to zero for identification.

Functions

prepare_maxdiff_data(task_df, items[, ...])

Reshape long-format MaxDiff data into padded arrays for the likelihood.

Classes

MaxDiffArrays

Preprocessed arrays ready for the MaxDiff likelihood.

MaxDiffMixedLogit(task_df, items[, ...])

Hierarchical MaxDiff (Best-Worst Scaling) model.