arXiv:2608.19231stat.MLcs.LG2026-08

TorchDCM让离散选择模型在GPU上加速计算,兼顾经济学完整性和可微分编程。

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

论文配图:TorchDCM: A Unified PyTorch-Native Package for Discrete Choice Modeling
图 1 · 摘自论文原文
  • 基于PyTorch构建统一计算引擎,支持多种选择模型的自动求导与并行计算
  • 相比Biogeme和Apollo,平均提速89.1%~99.7%,CUDA下再提速12.0~71.0倍
  • 适合需要高效估计与可微分建模的交通、消费等行为经济学研究者

估算大规模且依赖模拟的离散选择模型(DCMs)需要在大量观测、备选方案和抽样中反复计算效用、概率、导数和模拟似然。现有软件虽具备成熟的计量经济流程,但近年的GPU工具仅覆盖部分模型,导致计量覆盖与可扩展可微计算之间存在空白。我们提出TorchDCM,一个开源的Python包,将选择数据与模型设定编译为统一的PyTorch原生似然引擎,可在CPU或CUDA设备上完成估计、推断、预测和结构化报告。该包涵盖Biogeme和Apollo中的主要计量功能,包括多项式、嵌套、混合、有序、潜在变量及面板似然,并支持不规则选择集、参数约束、协方差估计、支付意愿分析、弹性计算及可扩展似然组件。我们在合成与真实数据的全量估计实验中,对比了七种其他估计包。TorchDCM完成全部45个合成案例,在所有可比合成案例中运行最快,且在每项对比中均满足预设最终对数似然容差,至少有两个可比解。相较Biogeme和Apollo,其平均运行时间减少89.1%~99.7%。使用CUDA时,相对于单核TorchDCM实现12.0~71.0倍加速。结果确立了可扩展、可复现的计量估计与可微选择模型开发基础。开源代码与执行示例见https://github.com/mbc96325/torchdcm。

原文摘要 · Abstract (English)

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. 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.

离散选择PyTorch加速计算可微分建模

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。