arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~

TorchDCM:一个基于PyTorch原生的离散选择建模统一软件包

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

Baichuan Mo, Zhengzhong Ricky You, Xiqun Michael Chen, Ruimin Li

arXiv 2608.19231首次发表:更新:

发表机构

Tsinghua University; Zhejiang University(清华大学; 浙江大学)

机构由 AI 辅助整理,请以论文原文为准。

AI 中文总结

TorchDCM是基于PyTorch的开源离散选择建模软件包,覆盖Biogeme和Apollo的主要功能,在合成与真实数据实验中速度远超同类工具,为相关建模提供可扩展可复现的基础。

AI 中文摘要

估计大规模且对模拟资源要求高的离散选择模型(Discrete Choice Models,DCMs)需要在大量观测值、备选方案和抽样上反复计算效用、概率、导数及模拟似然。现有DCM软件提供成熟的计量经济学工作流,而近期面向GPU的工具仅加速了部分模型,在计量经济学覆盖范围与可扩展的可微计算之间存在缺口。我们推出TorchDCM,这是一个开源Python离散选择建模软件包,它将选择数据和模型规范编译为统一的PyTorch原生似然引擎,可在CPU或CUDA设备上用于估计、推断、预测及结构化报告。该软件包覆盖了Biogeme和Apollo所具备的主要计量经济学功能,包括多项Logit、嵌套Logit、混合Logit、有序选择、潜变量及面板数据似然;还支持不规则选择集、约束参数、协方差估计、支付意愿分析、弹性计算及可扩展的似然组件。我们在对齐的合成数据和真实数据全估计实验中,将TorchDCM与其他7个估计软件包进行对比:TorchDCM完成了全部45个合成案例,在每个可比合成案例中运行速度最快,且在与至少两个可比方案的所有对比中均满足预先设定的最终对数似然容差。更具体而言,在各类模型-数据设置下,它相较于Biogeme和Apollo将中位数运行时间缩短了89.1%-99.7%;CUDA相较于单线程TorchDCM还能提供12.0-71.0倍的额外加速。这些结果为计量经济学估计和可微选择模型开发建立了可扩展且可复现的基础。该开源软件包及已运行的示例可在指定网址获取。

英文摘要

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.

论文原文

arXiv 摘要页 · PDF 原文 · HTML 原文

↑