TorchDCM: A Unified PyTorch-Native Package for Discrete Choice Modeling

Baichuan Mo, Zhengzhong Ricky You, Xiqun Michael Chen, Ruimin Li
8/4/2026
stat.MLcs.LG

Official code: mbc96325/torchdcm (3 stars, Python, MIT, last commit 2026-07-31).

Abstract

Estimating large and simulation-intensive discrete choice models (DCMs) requires repeated evaluation of utilities, probabilities, derivatives, and simulated likelihoods over many observations, alternatives, and draws. Existing DCM software provides mature econometric workflows, while recent GPU-oriented tools accelerate selected models, leaving a gap between econometric coverage and scalable differentiable computation.

Show full abstract

We introduce TorchDCM, an open Python package for discrete choice modeling that compiles choice data and model specifications into a unified PyTorch-native likelihood engine for estimation, inference, prediction, and structured reporting on CPU or CUDA devices. The package covers the principal econometric functionality available across Biogeme and Apollo, including multinomial, nested, mixed, ordered, latent-variable, and panel likelihoods. It also supports ragged choice sets, constrained parameters, covariance estimation, willingness-to-pay analysis, elasticities, and extensible likelihood components. We evaluate TorchDCM against seven other estimation packages in aligned synthetic and real-data full-estimation experiments. TorchDCM completes all 45 synthetic cases, runs fastest in every comparable synthetic case, and satisfies the prespecified final-log-likelihood tolerance in every comparison with at least two comparable solutions. More precisely, it reduces median runtime by 89.1%-99.7% relative to Biogeme and Apollo across model-data settings. CUDA provides an additional 12.0-71.0x speedup over single-core TorchDCM. These results establish a scalable and reproducible foundation for econometric estimation and differentiable choice-model development. The open-source package and executed examples are available at https://github.com/mbc96325/torchdcm.

View on arXivView PDF

Code Implementations(1)

mbc96325/torchdcmOfficial100%
MIT

TorchDCM: A Unified PyTorch-Native Package for Discrete Choice Modeling

30PythonJul 4, 20264 months agoMIT

Similar Papers

Cite this paper

@article{mo2026torchdcm,
  title  = {TorchDCM: A Unified PyTorch-Native Package for Discrete Choice Modeling},
  author = {Baichuan Mo and Zhengzhong Ricky You and Xiqun Michael Chen and Ruimin Li},
  year   = {2026},
  eprint = {2608.19231},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.19231v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2608.19231.svg)](https://codeofpaper.com/paper/2608.19231)

Discussion