pybhatlib 0.3.1__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/.gitignore +24 -0
  2. pybhatlib-0.4.0/CHANGELOG.md +71 -0
  3. pybhatlib-0.4.0/CONTRIBUTING.md +188 -0
  4. pybhatlib-0.4.0/PKG-INFO +239 -0
  5. pybhatlib-0.4.0/README.md +199 -0
  6. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/data/TRAVELMODE.csv +1126 -1126
  7. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/data/TRAVELMODE_synthetic.csv +1126 -1126
  8. pybhatlib-0.4.0/examples/data/WorkshopData_ToursimExp.csv +1501 -0
  9. pybhatlib-0.4.0/examples/data/Workshop_SCAG_Est.csv +1501 -0
  10. pybhatlib-0.4.0/examples/data/modeData.csv +3594 -0
  11. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/mnp_age45.py +1 -1
  12. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/mnp_flexible_cov.py +1 -1
  13. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/mnp_iid.py +1 -1
  14. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/mnp_mixture.py +1 -1
  15. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/mnp_random_coefficients.py +1 -1
  16. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/morp_example.py +12 -4
  17. pybhatlib-0.4.0/examples/tutorials/_convert_to_ipynb.py +445 -0
  18. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t00_quickstart.py +137 -131
  19. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t01a_vectorization.py +163 -144
  20. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t01b_ldlt.py +135 -132
  21. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t01c_truncated_mvn.py +169 -117
  22. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t02a_gradcovcor.py +227 -153
  23. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t02b_spherical.py +147 -143
  24. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t02c_chain_rules.py +202 -176
  25. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t03a_mvncd_methods.py +199 -134
  26. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t03b_mvncd_gradients.py +166 -152
  27. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t03c_mvncd_rect.py +172 -158
  28. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t03d_univariate_cdfs.py +189 -162
  29. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t03e_bhat2018_table1.py +403 -368
  30. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04a_mnp_iid.py +271 -183
  31. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04b_mnp_flexible_cov.py +307 -194
  32. pybhatlib-0.4.0/examples/tutorials/python_scripts/t04c_mnp_heteronly.py +250 -0
  33. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04d_mnp_random_coefficients.py +308 -232
  34. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04e_mnp_mixture.py +276 -209
  35. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04f_mnp_control_options.py +314 -191
  36. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04g_mnp_forecasting.py +262 -166
  37. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04h_bhatlib_table1.py +566 -447
  38. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t04i_bhat2018_table2.py +736 -609
  39. pybhatlib-0.4.0/examples/tutorials/python_scripts/t05b_morp_ate_predict.py +342 -0
  40. pybhatlib-0.4.0/examples/tutorials/python_scripts/t06a_backend_switching.py +353 -0
  41. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t06b_custom_specs.py +228 -224
  42. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/python_scripts/t06c_gradient_verification.py +298 -271
  43. pybhatlib-0.4.0/examples/tutorials/python_scripts/t07a_mdcev_trad.py +286 -0
  44. pybhatlib-0.4.0/examples/tutorials/python_scripts/t07b_mdcev_lin.py +254 -0
  45. pybhatlib-0.4.0/examples/tutorials/python_scripts/t08a_mnl.py +38 -0
  46. pybhatlib-0.4.0/examples/tutorials/python_scripts/t09a_lr.py +238 -0
  47. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t00_quickstart.ipynb +150 -115
  48. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t01a_vectorization.ipynb +173 -131
  49. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t01b_ldlt.ipynb +140 -99
  50. pybhatlib-0.4.0/examples/tutorials/t01c_truncated_mvn.ipynb +194 -0
  51. pybhatlib-0.4.0/examples/tutorials/t02a_gradcovcor.ipynb +232 -0
  52. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t02b_spherical.ipynb +133 -115
  53. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t02c_chain_rules.ipynb +114 -114
  54. pybhatlib-0.4.0/examples/tutorials/t03a_mvncd_methods.ipynb +195 -0
  55. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t03b_mvncd_gradients.ipynb +140 -115
  56. pybhatlib-0.4.0/examples/tutorials/t03c_mvncd_rect.ipynb +180 -0
  57. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t03d_univariate_cdfs.ipynb +130 -115
  58. pybhatlib-0.4.0/examples/tutorials/t03e_bhat2018_table1.ipynb +224 -0
  59. pybhatlib-0.4.0/examples/tutorials/t04a_mnp_iid.ipynb +314 -0
  60. pybhatlib-0.4.0/examples/tutorials/t04b_mnp_flexible_cov.ipynb +331 -0
  61. pybhatlib-0.4.0/examples/tutorials/t04c_mnp_heteronly.ipynb +196 -0
  62. pybhatlib-0.4.0/examples/tutorials/t04d_mnp_random_coefficients.ipynb +340 -0
  63. pybhatlib-0.4.0/examples/tutorials/t04e_mnp_mixture.ipynb +319 -0
  64. pybhatlib-0.4.0/examples/tutorials/t04f_mnp_control_options.ipynb +295 -0
  65. pybhatlib-0.4.0/examples/tutorials/t04g_mnp_forecasting.ipynb +211 -0
  66. pybhatlib-0.4.0/examples/tutorials/t04h_bhatlib_table1.ipynb +581 -0
  67. pybhatlib-0.4.0/examples/tutorials/t04i_bhat2018_table2.ipynb +507 -0
  68. pybhatlib-0.4.0/examples/tutorials/t05b_morp_ate_predict.ipynb +272 -0
  69. pybhatlib-0.4.0/examples/tutorials/t06a_backend_switching.ipynb +307 -0
  70. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/tutorials/t06b_custom_specs.ipynb +130 -130
  71. pybhatlib-0.4.0/examples/tutorials/t06c_gradient_verification.ipynb +315 -0
  72. pybhatlib-0.4.0/examples/tutorials/t07a_mdcev_trad.ipynb +298 -0
  73. pybhatlib-0.4.0/examples/tutorials/t07b_mdcev_lin.ipynb +267 -0
  74. pybhatlib-0.4.0/examples/tutorials/t08a_mnl.ipynb +35 -0
  75. pybhatlib-0.4.0/examples/tutorials/t09a_lr.ipynb +320 -0
  76. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/pyproject.toml +28 -3
  77. pybhatlib-0.4.0/src/pybhatlib/__init__.py +100 -0
  78. pybhatlib-0.4.0/src/pybhatlib/_version.py +1 -0
  79. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/backend/_numpy_backend.py +6 -4
  80. pybhatlib-0.4.0/src/pybhatlib/gradmvn/__init__.py +116 -0
  81. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_bivariate_trunc.py +15 -9
  82. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_cond_trunc_grads.py +11 -5
  83. pybhatlib-0.4.0/src/pybhatlib/gradmvn/_logit_dist.py +1491 -0
  84. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_mvncd.py +711 -46
  85. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_mvncd_grad.py +8 -2
  86. pybhatlib-0.4.0/src/pybhatlib/gradmvn/_mvncd_grad_analytic.py +738 -0
  87. pybhatlib-0.4.0/src/pybhatlib/gradmvn/_mvncd_grad_ovus.py +539 -0
  88. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_mvncd_ssj.py +4 -4
  89. pybhatlib-0.4.0/src/pybhatlib/gradmvn/_mvncd_torch.py +372 -0
  90. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_ordering.py +10 -3
  91. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_other_dists.py +10 -4
  92. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_partial_cdf.py +3 -2
  93. pybhatlib-0.4.0/src/pybhatlib/gradmvn/_pdfrectn.py +616 -0
  94. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_trunc_grads.py +20 -14
  95. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_truncated.py +15 -9
  96. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/gradmvn/_univariate.py +198 -9
  97. pybhatlib-0.4.0/src/pybhatlib/io/_data_loader.py +158 -0
  98. pybhatlib-0.4.0/src/pybhatlib/matgradient/__init__.py +35 -0
  99. pybhatlib-0.4.0/src/pybhatlib/matgradient/_corr_chol.py +202 -0
  100. pybhatlib-0.4.0/src/pybhatlib/matgradient/_radial.py +425 -0
  101. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/matgradient/_spherical.py +73 -0
  102. pybhatlib-0.4.0/src/pybhatlib/mixed/__init__.py +81 -0
  103. pybhatlib-0.4.0/src/pybhatlib/mixed/_copula.py +500 -0
  104. pybhatlib-0.4.0/src/pybhatlib/mixed/_draws.py +281 -0
  105. pybhatlib-0.4.0/src/pybhatlib/mixed/_engine.py +595 -0
  106. pybhatlib-0.4.0/src/pybhatlib/mixed/_kernel.py +182 -0
  107. pybhatlib-0.4.0/src/pybhatlib/mixed/_predict.py +594 -0
  108. pybhatlib-0.4.0/src/pybhatlib/mixed/_rc_pipeline.py +612 -0
  109. pybhatlib-0.4.0/src/pybhatlib/mixed/_reparam.py +886 -0
  110. pybhatlib-0.4.0/src/pybhatlib/mixed/_spec.py +566 -0
  111. pybhatlib-0.4.0/src/pybhatlib/models/_ate_common.py +228 -0
  112. pybhatlib-0.4.0/src/pybhatlib/models/_base.py +41 -0
  113. pybhatlib-0.4.0/src/pybhatlib/models/_results_common.py +162 -0
  114. pybhatlib-0.4.0/src/pybhatlib/models/lr/__init__.py +17 -0
  115. pybhatlib-0.4.0/src/pybhatlib/models/lr/_lr_ate.py +234 -0
  116. pybhatlib-0.4.0/src/pybhatlib/models/lr/_lr_control.py +47 -0
  117. pybhatlib-0.4.0/src/pybhatlib/models/lr/_lr_forecast.py +29 -0
  118. pybhatlib-0.4.0/src/pybhatlib/models/lr/_lr_loglik.py +101 -0
  119. pybhatlib-0.4.0/src/pybhatlib/models/lr/_lr_model.py +250 -0
  120. pybhatlib-0.4.0/src/pybhatlib/models/lr/_lr_results.py +256 -0
  121. pybhatlib-0.4.0/src/pybhatlib/models/mdcev/__init__.py +34 -0
  122. pybhatlib-0.4.0/src/pybhatlib/models/mdcev/_mdcev_ate.py +282 -0
  123. pybhatlib-0.4.0/src/pybhatlib/models/mdcev/_mdcev_control.py +96 -0
  124. pybhatlib-0.4.0/src/pybhatlib/models/mdcev/_mdcev_forecast.py +430 -0
  125. pybhatlib-0.4.0/src/pybhatlib/models/mdcev/_mdcev_loglik.py +781 -0
  126. pybhatlib-0.4.0/src/pybhatlib/models/mdcev/_mdcev_model.py +594 -0
  127. pybhatlib-0.4.0/src/pybhatlib/models/mdcev/_mdcev_results.py +371 -0
  128. pybhatlib-0.4.0/src/pybhatlib/models/mdcev_mixed/__init__.py +48 -0
  129. pybhatlib-0.4.0/src/pybhatlib/models/mdcev_mixed/_mdcev_mixed_ate.py +225 -0
  130. pybhatlib-0.4.0/src/pybhatlib/models/mdcev_mixed/_mdcev_mixed_control.py +139 -0
  131. pybhatlib-0.4.0/src/pybhatlib/models/mdcev_mixed/_mdcev_mixed_forecast.py +514 -0
  132. pybhatlib-0.4.0/src/pybhatlib/models/mdcev_mixed/_mdcev_mixed_kernel.py +522 -0
  133. pybhatlib-0.4.0/src/pybhatlib/models/mdcev_mixed/_mdcev_mixed_model.py +750 -0
  134. pybhatlib-0.4.0/src/pybhatlib/models/mdcev_mixed/_mdcev_mixed_results.py +275 -0
  135. pybhatlib-0.4.0/src/pybhatlib/models/mixmnl/__init__.py +32 -0
  136. pybhatlib-0.4.0/src/pybhatlib/models/mixmnl/_mixmnl_ate.py +219 -0
  137. pybhatlib-0.4.0/src/pybhatlib/models/mixmnl/_mixmnl_control.py +125 -0
  138. pybhatlib-0.4.0/src/pybhatlib/models/mixmnl/_mixmnl_forecast.py +135 -0
  139. pybhatlib-0.4.0/src/pybhatlib/models/mixmnl/_mixmnl_kernel.py +149 -0
  140. pybhatlib-0.4.0/src/pybhatlib/models/mixmnl/_mixmnl_model.py +702 -0
  141. pybhatlib-0.4.0/src/pybhatlib/models/mixmnl/_mixmnl_results.py +268 -0
  142. pybhatlib-0.4.0/src/pybhatlib/models/mnl/__init__.py +18 -0
  143. pybhatlib-0.4.0/src/pybhatlib/models/mnl/_mnl_ate.py +316 -0
  144. pybhatlib-0.4.0/src/pybhatlib/models/mnl/_mnl_control.py +65 -0
  145. pybhatlib-0.4.0/src/pybhatlib/models/mnl/_mnl_forecast.py +73 -0
  146. pybhatlib-0.4.0/src/pybhatlib/models/mnl/_mnl_loglik.py +266 -0
  147. pybhatlib-0.4.0/src/pybhatlib/models/mnl/_mnl_model.py +410 -0
  148. pybhatlib-0.4.0/src/pybhatlib/models/mnl/_mnl_results.py +280 -0
  149. pybhatlib-0.4.0/src/pybhatlib/models/mnp/__init__.py +24 -0
  150. pybhatlib-0.4.0/src/pybhatlib/models/mnp/_mnp_ate.py +417 -0
  151. pybhatlib-0.4.0/src/pybhatlib/models/mnp/_mnp_control.py +147 -0
  152. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/models/mnp/_mnp_forecast.py +18 -39
  153. pybhatlib-0.4.0/src/pybhatlib/models/mnp/_mnp_grad_analytic.py +1545 -0
  154. pybhatlib-0.4.0/src/pybhatlib/models/mnp/_mnp_grad_gpu.py +447 -0
  155. pybhatlib-0.4.0/src/pybhatlib/models/mnp/_mnp_loglik.py +1717 -0
  156. pybhatlib-0.4.0/src/pybhatlib/models/mnp/_mnp_model.py +1729 -0
  157. pybhatlib-0.4.0/src/pybhatlib/models/mnp/_mnp_results.py +425 -0
  158. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/__init__.py +41 -0
  159. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/_mnpkercp_ate.py +287 -0
  160. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/_mnpkercp_control.py +139 -0
  161. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/_mnpkercp_diff.py +120 -0
  162. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/_mnpkercp_forecast.py +336 -0
  163. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/_mnpkercp_kernel.py +566 -0
  164. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/_mnpkercp_model.py +700 -0
  165. pybhatlib-0.4.0/src/pybhatlib/models/mnpkercp/_mnpkercp_results.py +272 -0
  166. pybhatlib-0.4.0/src/pybhatlib/models/morp/__init__.py +35 -0
  167. pybhatlib-0.4.0/src/pybhatlib/models/morp/_morp_ate.py +404 -0
  168. pybhatlib-0.4.0/src/pybhatlib/models/morp/_morp_control.py +277 -0
  169. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/models/morp/_morp_forecast.py +25 -21
  170. pybhatlib-0.4.0/src/pybhatlib/models/morp/_morp_grad_analytic.py +757 -0
  171. pybhatlib-0.4.0/src/pybhatlib/models/morp/_morp_loglik.py +386 -0
  172. pybhatlib-0.4.0/src/pybhatlib/models/morp/_morp_model.py +631 -0
  173. pybhatlib-0.4.0/src/pybhatlib/models/morp/_morp_report.py +317 -0
  174. pybhatlib-0.4.0/src/pybhatlib/models/morp/_morp_results.py +468 -0
  175. pybhatlib-0.4.0/src/pybhatlib/models/morp_flex/__init__.py +35 -0
  176. pybhatlib-0.4.0/src/pybhatlib/models/morp_flex/_morp_flex_ate.py +345 -0
  177. pybhatlib-0.4.0/src/pybhatlib/models/morp_flex/_morp_flex_control.py +146 -0
  178. pybhatlib-0.4.0/src/pybhatlib/models/morp_flex/_morp_flex_forecast.py +263 -0
  179. pybhatlib-0.4.0/src/pybhatlib/models/morp_flex/_morp_flex_kernel.py +864 -0
  180. pybhatlib-0.4.0/src/pybhatlib/models/morp_flex/_morp_flex_model.py +614 -0
  181. pybhatlib-0.4.0/src/pybhatlib/models/morp_flex/_morp_flex_results.py +280 -0
  182. pybhatlib-0.4.0/src/pybhatlib/optim/_scipy_optim.py +287 -0
  183. pybhatlib-0.4.0/src/pybhatlib/utils/__init__.py +41 -0
  184. pybhatlib-0.4.0/src/pybhatlib/utils/_logistic.py +239 -0
  185. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/utils/_qmc.py +19 -5
  186. pybhatlib-0.4.0/src/pybhatlib/utils/_quadrature.py +55 -0
  187. pybhatlib-0.4.0/src/pybhatlib/utils/_safe_reparam.py +154 -0
  188. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/vecup/__init__.py +20 -0
  189. pybhatlib-0.4.0/src/pybhatlib/vecup/_ldlt.py +297 -0
  190. pybhatlib-0.4.0/src/pybhatlib/vecup/_panel.py +236 -0
  191. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/vecup/_truncnorm.py +11 -5
  192. pybhatlib-0.4.0/src/pybhatlib/vecup/_yj.py +519 -0
  193. pybhatlib-0.4.0/tests/fixtures/bhatlib_table2_targets.json +102 -0
  194. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/ass.csv +10 -0
  195. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/b.csv +27 -0
  196. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r1.csv +1500 -0
  197. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r10.csv +1500 -0
  198. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r2.csv +1500 -0
  199. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r3.csv +1500 -0
  200. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r4.csv +1500 -0
  201. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r5.csv +1500 -0
  202. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r6.csv +1500 -0
  203. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r7.csv +1500 -0
  204. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r8.csv +1500 -0
  205. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/draws_r9.csv +1500 -0
  206. pybhatlib-0.4.0/tests/fixtures/mixed/mdcev/scag_converged/ll_obs.csv +1500 -0
  207. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/ass.csv +15 -0
  208. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/b.csv +12 -0
  209. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r1.csv +1125 -0
  210. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r10.csv +1125 -0
  211. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r11.csv +1125 -0
  212. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r12.csv +1125 -0
  213. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r13.csv +1125 -0
  214. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r14.csv +1125 -0
  215. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r15.csv +1125 -0
  216. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r2.csv +1125 -0
  217. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r3.csv +1125 -0
  218. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r4.csv +1125 -0
  219. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r5.csv +1125 -0
  220. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r6.csv +1125 -0
  221. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r7.csv +1125 -0
  222. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r8.csv +1125 -0
  223. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/draws_r9.csv +1125 -0
  224. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/grad_obs.csv +1125 -0
  225. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/ll_obs.csv +1125 -0
  226. pybhatlib-0.4.0/tests/fixtures/mixed/mnl/travelmode_converged/meta.json +46 -0
  227. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/ass.csv +5 -0
  228. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/b.csv +18 -0
  229. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/draws_r1.csv +1125 -0
  230. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/draws_r2.csv +1125 -0
  231. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/draws_r3.csv +1125 -0
  232. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/draws_r4.csv +1125 -0
  233. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/draws_r5.csv +1125 -0
  234. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_copula/ll_obs.csv +1125 -0
  235. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/ass.csv +5 -0
  236. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/b.csv +18 -0
  237. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/draws_r1.csv +1125 -0
  238. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/draws_r2.csv +1125 -0
  239. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/draws_r3.csv +1125 -0
  240. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/draws_r4.csv +1125 -0
  241. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/draws_r5.csv +1125 -0
  242. pybhatlib-0.4.0/tests/fixtures/mixed/mnp/travelmode_nocopula/ll_obs.csv +1125 -0
  243. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/ass.csv +10 -0
  244. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/b.csv +21 -0
  245. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r1.csv +2323 -0
  246. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r10.csv +2323 -0
  247. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r2.csv +2323 -0
  248. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r3.csv +2323 -0
  249. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r4.csv +2323 -0
  250. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r5.csv +2323 -0
  251. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r6.csv +2323 -0
  252. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r7.csv +2323 -0
  253. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r8.csv +2323 -0
  254. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/draws_r9.csv +2323 -0
  255. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/ll_obs.csv +2323 -0
  256. pybhatlib-0.4.0/tests/fixtures/mixed/morp/panelcommute_converged/meta.json +25 -0
  257. pybhatlib-0.4.0/tests/test_api_harmonization.py +337 -0
  258. pybhatlib-0.4.0/tests/test_gradmvn/test_mvncd_batch.py +169 -0
  259. pybhatlib-0.4.0/tests/test_gradmvn/test_mvncd_grad_ovus.py +303 -0
  260. pybhatlib-0.4.0/tests/test_gradmvn/test_mvncd_rect_inf_bounds.py +400 -0
  261. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_matgradient/test_spherical.py +29 -0
  262. pybhatlib-0.4.0/tests/test_mixed/__init__.py +0 -0
  263. pybhatlib-0.4.0/tests/test_mixed/test_copula.py +301 -0
  264. pybhatlib-0.4.0/tests/test_mixed/test_corr_chol.py +173 -0
  265. pybhatlib-0.4.0/tests/test_mixed/test_draws.py +182 -0
  266. pybhatlib-0.4.0/tests/test_mixed/test_engine_master.py +162 -0
  267. pybhatlib-0.4.0/tests/test_mixed/test_logistic.py +72 -0
  268. pybhatlib-0.4.0/tests/test_mixed/test_logitmod.py +108 -0
  269. pybhatlib-0.4.0/tests/test_mixed/test_mdcev_mixed_ate.py +456 -0
  270. pybhatlib-0.4.0/tests/test_mixed/test_mdcev_mixed_collapse.py +172 -0
  271. pybhatlib-0.4.0/tests/test_mixed/test_mdcev_mixed_gauss_parity.py +158 -0
  272. pybhatlib-0.4.0/tests/test_mixed/test_mdcev_mixed_kernel.py +206 -0
  273. pybhatlib-0.4.0/tests/test_mixed/test_mdcev_mixed_master.py +161 -0
  274. pybhatlib-0.4.0/tests/test_mixed/test_mixed_predict.py +215 -0
  275. pybhatlib-0.4.0/tests/test_mixed/test_mixmnl_ate.py +383 -0
  276. pybhatlib-0.4.0/tests/test_mixed/test_mixmnl_collapse.py +161 -0
  277. pybhatlib-0.4.0/tests/test_mixed/test_mixmnl_facade.py +330 -0
  278. pybhatlib-0.4.0/tests/test_mixed/test_mixmnl_gauss_parity.py +112 -0
  279. pybhatlib-0.4.0/tests/test_mixed/test_mixmnl_kernel.py +136 -0
  280. pybhatlib-0.4.0/tests/test_mixed/test_mnp_diff.py +120 -0
  281. pybhatlib-0.4.0/tests/test_mixed/test_mnp_spec.py +250 -0
  282. pybhatlib-0.4.0/tests/test_mixed/test_mnpkercp_ate.py +443 -0
  283. pybhatlib-0.4.0/tests/test_mixed/test_mnpkercp_corr_grad.py +134 -0
  284. pybhatlib-0.4.0/tests/test_mixed/test_mnpkercp_gauss_parity.py +197 -0
  285. pybhatlib-0.4.0/tests/test_mixed/test_mnpkercp_kernel.py +167 -0
  286. pybhatlib-0.4.0/tests/test_mixed/test_mnpkercp_master.py +132 -0
  287. pybhatlib-0.4.0/tests/test_mixed/test_mnpkercp_master_corr.py +132 -0
  288. pybhatlib-0.4.0/tests/test_mixed/test_mnpkercp_master_sparse_corr.py +131 -0
  289. pybhatlib-0.4.0/tests/test_mixed/test_morp_flex_ate.py +387 -0
  290. pybhatlib-0.4.0/tests/test_mixed/test_morp_flex_gauss_parity.py +107 -0
  291. pybhatlib-0.4.0/tests/test_mixed/test_morp_flex_kernel.py +207 -0
  292. pybhatlib-0.4.0/tests/test_mixed/test_morp_flex_master.py +112 -0
  293. pybhatlib-0.4.0/tests/test_mixed/test_morp_spec.py +320 -0
  294. pybhatlib-0.4.0/tests/test_mixed/test_panel.py +174 -0
  295. pybhatlib-0.4.0/tests/test_mixed/test_pdfrectn.py +144 -0
  296. pybhatlib-0.4.0/tests/test_mixed/test_rc_pipeline.py +230 -0
  297. pybhatlib-0.4.0/tests/test_mixed/test_spec.py +398 -0
  298. pybhatlib-0.4.0/tests/test_mixed/test_yj.py +210 -0
  299. pybhatlib-0.4.0/tests/test_models/test_ate_common.py +99 -0
  300. pybhatlib-0.4.0/tests/test_models/test_ate_from_params.py +189 -0
  301. pybhatlib-0.4.0/tests/test_models/test_lr.py +152 -0
  302. pybhatlib-0.4.0/tests/test_models/test_mdcev.py +244 -0
  303. pybhatlib-0.4.0/tests/test_models/test_mdcev_scenarios.py +82 -0
  304. pybhatlib-0.4.0/tests/test_models/test_mnl.py +180 -0
  305. pybhatlib-0.4.0/tests/test_models/test_mnl_ate_from_params.py +76 -0
  306. pybhatlib-0.4.0/tests/test_models/test_mnp_active_mask_verbose.py +454 -0
  307. pybhatlib-0.4.0/tests/test_models/test_mnp_ate_scenarios.py +449 -0
  308. pybhatlib-0.4.0/tests/test_models/test_mnp_gauss_parity.py +134 -0
  309. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_models/test_mnp_grad.py +9 -7
  310. pybhatlib-0.4.0/tests/test_models/test_mnp_grad_mixture.py +444 -0
  311. pybhatlib-0.4.0/tests/test_models/test_mnp_mixture_ranvars.py +517 -0
  312. pybhatlib-0.4.0/tests/test_models/test_mnp_perobs_scores.py +173 -0
  313. pybhatlib-0.4.0/tests/test_models/test_mnp_se_options.py +140 -0
  314. pybhatlib-0.4.0/tests/test_models/test_mnp_table2_parity.py +349 -0
  315. pybhatlib-0.4.0/tests/test_models/test_mnp_unpar_se.py +566 -0
  316. pybhatlib-0.4.0/tests/test_models/test_model_facade.py +263 -0
  317. pybhatlib-0.4.0/tests/test_models/test_morp.py +639 -0
  318. pybhatlib-0.4.0/tests/test_models/test_morp_analytic_gradient.py +531 -0
  319. pybhatlib-0.4.0/tests/test_models/test_morp_gauss_parity.py +257 -0
  320. pybhatlib-0.4.0/tests/test_models/test_morp_per_outcome_spec.py +451 -0
  321. pybhatlib-0.4.0/tests/test_models/test_morp_scenarios.py +131 -0
  322. pybhatlib-0.4.0/tests/test_models/test_results_harmonization.py +209 -0
  323. pybhatlib-0.4.0/tests/test_reparam_extreme_inputs.py +84 -0
  324. pybhatlib-0.3.1/PKG-INFO +0 -124
  325. pybhatlib-0.3.1/README.md +0 -86
  326. pybhatlib-0.3.1/examples/tutorials/_convert_to_ipynb.py +0 -224
  327. pybhatlib-0.3.1/examples/tutorials/python_scripts/t04c_mnp_heteronly.py +0 -156
  328. pybhatlib-0.3.1/examples/tutorials/python_scripts/t05b_morp_ate_predict.py +0 -173
  329. pybhatlib-0.3.1/examples/tutorials/python_scripts/t06a_backend_switching.py +0 -141
  330. pybhatlib-0.3.1/examples/tutorials/t01c_truncated_mvn.ipynb +0 -99
  331. pybhatlib-0.3.1/examples/tutorials/t02a_gradcovcor.ipynb +0 -115
  332. pybhatlib-0.3.1/examples/tutorials/t03a_mvncd_methods.ipynb +0 -99
  333. pybhatlib-0.3.1/examples/tutorials/t03c_mvncd_rect.ipynb +0 -99
  334. pybhatlib-0.3.1/examples/tutorials/t03e_bhat2018_table1.ipynb +0 -44
  335. pybhatlib-0.3.1/examples/tutorials/t04a_mnp_iid.ipynb +0 -99
  336. pybhatlib-0.3.1/examples/tutorials/t04b_mnp_flexible_cov.ipynb +0 -115
  337. pybhatlib-0.3.1/examples/tutorials/t04c_mnp_heteronly.ipynb +0 -115
  338. pybhatlib-0.3.1/examples/tutorials/t04d_mnp_random_coefficients.ipynb +0 -99
  339. pybhatlib-0.3.1/examples/tutorials/t04e_mnp_mixture.ipynb +0 -99
  340. pybhatlib-0.3.1/examples/tutorials/t04f_mnp_control_options.ipynb +0 -131
  341. pybhatlib-0.3.1/examples/tutorials/t04g_mnp_forecasting.ipynb +0 -115
  342. pybhatlib-0.3.1/examples/tutorials/t04h_bhatlib_table1.ipynb +0 -163
  343. pybhatlib-0.3.1/examples/tutorials/t04i_bhat2018_table2.ipynb +0 -163
  344. pybhatlib-0.3.1/examples/tutorials/t05b_morp_ate_predict.ipynb +0 -115
  345. pybhatlib-0.3.1/examples/tutorials/t06a_backend_switching.ipynb +0 -115
  346. pybhatlib-0.3.1/examples/tutorials/t06c_gradient_verification.ipynb +0 -131
  347. pybhatlib-0.3.1/src/pybhatlib/__init__.py +0 -5
  348. pybhatlib-0.3.1/src/pybhatlib/_version.py +0 -1
  349. pybhatlib-0.3.1/src/pybhatlib/gradmvn/__init__.py +0 -52
  350. pybhatlib-0.3.1/src/pybhatlib/gradmvn/_mvncd_grad_analytic.py +0 -255
  351. pybhatlib-0.3.1/src/pybhatlib/io/_data_loader.py +0 -44
  352. pybhatlib-0.3.1/src/pybhatlib/matgradient/__init__.py +0 -18
  353. pybhatlib-0.3.1/src/pybhatlib/matgradient/_radial.py +0 -181
  354. pybhatlib-0.3.1/src/pybhatlib/models/_base.py +0 -14
  355. pybhatlib-0.3.1/src/pybhatlib/models/mnp/__init__.py +0 -14
  356. pybhatlib-0.3.1/src/pybhatlib/models/mnp/_mnp_ate.py +0 -192
  357. pybhatlib-0.3.1/src/pybhatlib/models/mnp/_mnp_control.py +0 -89
  358. pybhatlib-0.3.1/src/pybhatlib/models/mnp/_mnp_grad_analytic.py +0 -386
  359. pybhatlib-0.3.1/src/pybhatlib/models/mnp/_mnp_loglik.py +0 -575
  360. pybhatlib-0.3.1/src/pybhatlib/models/mnp/_mnp_model.py +0 -656
  361. pybhatlib-0.3.1/src/pybhatlib/models/mnp/_mnp_results.py +0 -184
  362. pybhatlib-0.3.1/src/pybhatlib/models/morp/__init__.py +0 -17
  363. pybhatlib-0.3.1/src/pybhatlib/models/morp/_morp_ate.py +0 -119
  364. pybhatlib-0.3.1/src/pybhatlib/models/morp/_morp_control.py +0 -56
  365. pybhatlib-0.3.1/src/pybhatlib/models/morp/_morp_loglik.py +0 -256
  366. pybhatlib-0.3.1/src/pybhatlib/models/morp/_morp_model.py +0 -276
  367. pybhatlib-0.3.1/src/pybhatlib/models/morp/_morp_results.py +0 -154
  368. pybhatlib-0.3.1/src/pybhatlib/optim/_scipy_optim.py +0 -156
  369. pybhatlib-0.3.1/src/pybhatlib/utils/__init__.py +0 -6
  370. pybhatlib-0.3.1/src/pybhatlib/vecup/_ldlt.py +0 -160
  371. pybhatlib-0.3.1/tests/test_models/test_morp.py +0 -210
  372. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/LICENSE +0 -0
  373. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/data/generate_travelmode.py +0 -0
  374. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/examples/mnp_ate_analysis.py +0 -0
  375. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/backend/__init__.py +0 -0
  376. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/backend/_array_api.py +0 -0
  377. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/backend/_torch_backend.py +0 -0
  378. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/io/__init__.py +0 -0
  379. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/io/_spec_parser.py +0 -0
  380. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/matgradient/_chain_rules.py +0 -0
  381. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/matgradient/_gomegxomegax.py +0 -0
  382. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/matgradient/_gradcovcor.py +0 -0
  383. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/matgradient/_mat_grad_helpers.py +0 -0
  384. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/models/__init__.py +0 -0
  385. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/optim/__init__.py +0 -0
  386. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/optim/_convergence.py +0 -0
  387. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/optim/_torch_optim.py +0 -0
  388. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/utils/_seeds.py +0 -0
  389. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/utils/_validation.py +0 -0
  390. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/vecup/_mask.py +0 -0
  391. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/vecup/_nondiag.py +0 -0
  392. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/src/pybhatlib/vecup/_vec_ops.py +0 -0
  393. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/__init__.py +0 -0
  394. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/conftest.py +0 -0
  395. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_backend/__init__.py +0 -0
  396. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_backend/test_array_api.py +0 -0
  397. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/__init__.py +0 -0
  398. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_bivariate_trunc.py +0 -0
  399. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_cond_trunc_grads.py +0 -0
  400. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_mvncd.py +0 -0
  401. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_mvncd_grad_analytic.py +0 -0
  402. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_mvncd_methods.py +0 -0
  403. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_mvncd_rect.py +0 -0
  404. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_ordering.py +0 -0
  405. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_other_dists.py +0 -0
  406. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_gradmvn/test_trunc_grads.py +0 -0
  407. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_integration/__init__.py +0 -0
  408. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_matgradient/__init__.py +0 -0
  409. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_matgradient/test_gradcovcor.py +0 -0
  410. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_matgradient/test_mat_grad_helpers.py +0 -0
  411. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_matgradient/test_radial.py +0 -0
  412. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_models/__init__.py +0 -0
  413. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_models/test_mnp_control.py +0 -0
  414. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_vecup/__init__.py +0 -0
  415. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_vecup/test_ldlt.py +0 -0
  416. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_vecup/test_ldlt_rank2.py +0 -0
  417. {pybhatlib-0.3.1 → pybhatlib-0.4.0}/tests/test_vecup/test_vec_ops.py +0 -0
@@ -28,10 +28,18 @@ htmlcov/
28
28
  *.dat
29
29
  *.pkl
30
30
  *.pdf
31
+ *.tar.gz
31
32
  results/
33
+ experiments/
34
+ pr32-*.md
32
35
 
33
36
  # Original GAUSS source
34
37
  chandra_code/
38
+ UTAcode_0402/
39
+ slides/
40
+ docs/
41
+ Gauss Files and Comparison/
42
+ anna0605/
35
43
 
36
44
  # Project-local docs (not for repo)
37
45
  CLAUDE.md
@@ -55,3 +63,19 @@ nul
55
63
  *.fdb_latexmk
56
64
  *.fls
57
65
  *.synctex.gz
66
+
67
+ # PESOSE proposal working files — internal, NOT for the (soon-public) repo
68
+ PESOSE_*
69
+ PESOSE-related
70
+ .env
71
+ .claude
72
+
73
+ pesose*
74
+
75
+ # Local scratch / harness output (mixed-model work)
76
+ issue*
77
+ PR32*
78
+ 0714*
79
+ 0717*
80
+ gauss_harness/
81
+ bench/*_log.csv
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ All notable changes to pybhatlib are documented here. The format is based on
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [0.4.0] - 2026-09-16
8
+
9
+ ### Added
10
+ - **Linear regression (LR)** — `LRModel` / `LRControl` / `LRResults`: one
11
+ continuous outcome solved in closed form (SVD least squares) with classical,
12
+ White-robust, and BHHH standard errors; the residual standard deviation
13
+ `sigma` is reported as the trailing parameter (MDCEV convention);
14
+ `lr_predict`, `lr_ate` / `lr_ate_from_params` on the shared `scenarios=`
15
+ API; tutorial `t09a_lr`.
16
+ - **Mixed (simulation-based) model family** — a shared maximum-simulated-
17
+ likelihood engine (Halton draws, panel broadcast, normal / log-normal /
18
+ Yeo-Johnson coefficient transforms, analytic scores through the
19
+ reparameterisation Jacobians), plus four models built on it:
20
+ `MixMNLModel` (mixed multinomial logit), `MNPKerCPModel` (mixed MNP
21
+ coupling random coefficients to the kernel error through a copula),
22
+ `MORPFlexModel` (mixed MORP with a flexible Yeo-Johnson
23
+ kernel and rectangle MVNCD), and `MDCEVMixedModel` (mixed MDCEV with a
24
+ vectorized per-draw kernel). These are new and still under active
25
+ refinement; the closed-form models above are the stable API.
26
+
27
+ ### Fixed
28
+ - **MNP mixture-of-normals** — coefficients that are not random now stay shared
29
+ across segments instead of being re-estimated per segment.
30
+
31
+ ## [0.3.2] - 2026-07-22
32
+
33
+ First version available on PyPI. Identical in code to 0.3.1; released under a new
34
+ patch number only because 0.3.1's filenames had already been reserved on PyPI (an
35
+ earlier 0.3.1 upload was deleted, and PyPI never permits reusing a deleted
36
+ filename). See the 0.3.1 entry below for the full feature list.
37
+
38
+ ## [0.3.1] - 2026-07-22
39
+
40
+ Prepared as the first PyPI release but withdrawn before general availability; never
41
+ installable from PyPI. Superseded by 0.3.2 (same code). Contents:
42
+
43
+ ### Models
44
+ - **Multinomial Probit (MNP)** — IID, flexible covariance, heteroscedastic-only,
45
+ random coefficients, and mixture-of-normals specifications.
46
+ - **Multivariate Ordered Response Probit (MORP)** — multiple ordinal outcomes
47
+ with shared covariance and per-outcome `spec` mapping.
48
+ - **Multiple Discrete-Continuous Extreme Value (MDCEV)** — traditional
49
+ (Bhat 2008) and linear (Bhat 2018) outside-good utility specifications.
50
+ - **Multinomial Logit (MNL)**.
51
+
52
+ ### Numerical core
53
+ - `vecup` — vecdup, matdupfull, LDLT decomposition, truncated MVN moments.
54
+ - `matgradient` — gradcovcor, gomegxomegax, spherical / Cholesky parameterizations.
55
+ - `gradmvn` — Bhat (2018) MVNCD analytic approximation with analytic gradients.
56
+
57
+ ### Estimation & post-estimation
58
+ - BHHH / Hessian / sandwich standard-error estimators, computed at fit time.
59
+ - Average Treatment Effects (ATE) with scenario-matrix support, forecasting,
60
+ per-category MORP probability prediction, and ATEs computed directly from
61
+ supplied coefficients without re-fitting.
62
+ - Optional PyTorch backend (`pip install pybhatlib[torch]`) with GPU support;
63
+ all numerical functions accept an optional `xp` backend kwarg.
64
+
65
+ ### Verification
66
+ - Reproduces Table 1 of Bhat (2018) on the TRAVELMODE dataset: models (a)-(c)
67
+ match published log-likelihoods and BHHH standard errors to =0.001; model (d)
68
+ is documented as multi-modal.
69
+
70
+ [0.3.2]: https://github.com/UMN-Choi-Lab/pybhatlib/releases/tag/v0.3.2
71
+ [0.3.1]: https://github.com/UMN-Choi-Lab/pybhatlib/releases/tag/v0.3.1
@@ -0,0 +1,188 @@
1
+ # Contributing to pybhatlib
2
+
3
+ Thanks for your interest in contributing. This guide covers the pull request
4
+ workflow, local development setup, and the standards we maintain for
5
+ numerical correctness. It is written to be usable even if you are new to
6
+ GitHub — read top to bottom the first time.
7
+
8
+ ## Quick overview
9
+
10
+ - All changes go through a **pull request (PR)** — nobody pushes directly to `main`.
11
+ - Each PR covers **one logical change**, not a batch of unrelated edits.
12
+ - CI runs `pytest` automatically on every PR. **CI must pass before merging.**
13
+ - Because pybhatlib reproduces published log-likelihood values exactly, any
14
+ change that alters numerical results must be justified and verified.
15
+
16
+ ## Setting up locally
17
+
18
+ ```bash
19
+ git clone https://github.com/UMN-Choi-Lab/pybhatlib.git
20
+ cd pybhatlib
21
+ pip install -e ".[dev]"
22
+ ```
23
+
24
+ Verify the install:
25
+
26
+ ```bash
27
+ pytest tests/ -m "not slow"
28
+ ```
29
+
30
+ All tests should pass. If they do not, open an issue before making changes —
31
+ something in your environment is off, and PRs built on a broken baseline
32
+ waste review time.
33
+
34
+ ## The pull request workflow
35
+
36
+ ### 1. Create a branch
37
+
38
+ One branch per logical change. Short, descriptive names — not your username,
39
+ not a date.
40
+
41
+ ```bash
42
+ git checkout main
43
+ git pull origin main
44
+ git checkout -b fix-mixture-shared-coefs
45
+ ```
46
+
47
+ Good branch names: `fix-mixture-shared-coefs`, `add-mvncd-j5-benchmark`,
48
+ `docs-contributing-guide`.
49
+
50
+ Avoid: `dales-changes`, `update`, `wip`, `patch-1`.
51
+
52
+ ### 2. Make changes and commit
53
+
54
+ ```bash
55
+ # Edit files...
56
+ pytest tests/ -m "not slow" # Run tests before committing
57
+ git add <files>
58
+ git commit -m "Short imperative summary of the change"
59
+ ```
60
+
61
+ If you touch a tutorial, edit the `.py` script under
62
+ `examples/tutorials/python_scripts/` (the single source of truth) and
63
+ regenerate the notebooks — the `notebooks` CI job fails if they are stale or
64
+ missing:
65
+
66
+ ```bash
67
+ python examples/tutorials/_convert_to_ipynb.py
68
+ git add examples/tutorials/*.ipynb
69
+ ```
70
+
71
+ Commit message style:
72
+
73
+ - First line: imperative mood, under 72 characters
74
+ (`"Add shared-coefficient support for mixture-of-normals"`, not
75
+ `"Added ..."` or `"Changes to mixture"`).
76
+ - Optional body after a blank line explains *why*, not *what*.
77
+ - One commit per logical step is fine; squash trivial fixup commits before
78
+ pushing (`git rebase -i main`).
79
+
80
+ ### 3. Push and open the PR
81
+
82
+ ```bash
83
+ git push -u origin fix-mixture-shared-coefs
84
+ ```
85
+
86
+ GitHub prints a URL for opening the PR after the push — click it, or visit
87
+ the repo on github.com and look for the "Compare & pull request" banner.
88
+
89
+ PR description should cover:
90
+
91
+ - **What** changed (one or two sentences).
92
+ - **Why** the change is needed (link to an issue or email thread if relevant).
93
+ - **How it was tested** — which tests you ran, which tutorials you re-executed,
94
+ any benchmark numbers.
95
+ - **Verification impact** — if your change could affect log-likelihoods,
96
+ explicitly state whether you re-ran the Table 1 verification (see below).
97
+
98
+ ### 4. Review and merge
99
+
100
+ A maintainer reviews the PR, may request changes, and merges it. While the
101
+ PR is open:
102
+
103
+ - Push new commits to the same branch — they update the PR automatically.
104
+ - Do not force-push unless asked.
105
+ - Do not merge `main` into your branch unless requested; rebase if you must
106
+ update.
107
+
108
+ After merge, delete your branch:
109
+
110
+ ```bash
111
+ git checkout main
112
+ git pull origin main
113
+ git branch -d fix-mixture-shared-coefs
114
+ ```
115
+
116
+ ## Numerical verification (important)
117
+
118
+ pybhatlib reproduces exact log-likelihood values from BHATLIB Table 1:
119
+
120
+ | Model | LL |
121
+ |-------|-----|
122
+ | (a)(i) IID | −670.956 |
123
+ | (a)(ii) Flexible | −661.111 |
124
+ | (b) + AGE45 | −659.285 |
125
+ | (c) Random coefficient | −635.871 |
126
+ | (d) Mixture (nseg=2) | ≈−634.975 |
127
+
128
+ If your change touches any code under `src/pybhatlib/gradmvn/`,
129
+ `src/pybhatlib/matgradient/`, `src/pybhatlib/vecup/`, or
130
+ `src/pybhatlib/models/mnp/`, run the Table 1 tutorial locally before
131
+ requesting review:
132
+
133
+ ```bash
134
+ jupyter nbconvert --to notebook --execute examples/tutorials/t04h_bhatlib_table1.ipynb
135
+ ```
136
+
137
+ Include the resulting LL values in the PR description. If they differ from
138
+ the table, explain why the change is intentional — do not merge a regression
139
+ without discussion.
140
+
141
+ ## Code standards
142
+
143
+ - **Python**: PEP 8, 88-char line length (matches `ruff` config).
144
+ - **Type hints** on all public function signatures.
145
+ - **Docstrings** in NumPy style on all public functions.
146
+ - **Backend-aware numerical code** accepts an optional `xp` keyword for
147
+ NumPy / PyTorch backend selection.
148
+ - **Numba-compatible** in hot paths — use `scipy.special.ndtr`, not
149
+ `scipy.stats.norm.cdf`; avoid Python-level scipy.stats objects inside
150
+ JIT-compiled functions.
151
+ - **No module-level mutable state** — thread safety matters for parallel
152
+ gradient evaluations.
153
+ - **Private modules** are prefixed with an underscore (`_vec_ops.py`).
154
+
155
+ ## Running specific test subsets
156
+
157
+ ```bash
158
+ pytest tests/ # Everything including slow integration tests
159
+ pytest tests/ -m "not slow" # Skip slow tests (what CI runs)
160
+ pytest tests/ -m torch # Only PyTorch-backend tests (needs torch installed)
161
+ pytest tests/test_models/ # Just the model tests
162
+ pytest tests/ -k mnp # Tests matching "mnp" in name
163
+ ```
164
+
165
+ ## Scope rules
166
+
167
+ - **One logical change per PR.** Bundling a bug fix, a feature, and a refactor
168
+ into one PR makes review painful and makes `git bisect` useless if a
169
+ regression shows up later.
170
+ - **Do not reformat unrelated code** in your PR. If you notice style issues
171
+ elsewhere, open a separate PR for cleanup.
172
+ - **Performance changes need before/after numbers.** "Faster" is not
173
+ reviewable; "1.40s → 0.82s on Table 1 Model (a)(ii)" is.
174
+ - **Feature additions that change model semantics** (e.g., allowing
175
+ coefficients to be shared across mixture segments) should include a test
176
+ that pins the new behavior.
177
+
178
+ ## Getting help
179
+
180
+ - **Questions about an existing PR**: comment on the PR directly.
181
+ - **Questions about where to start**: open an issue with the `question` label.
182
+ - **Something is broken**: open an issue with a minimal reproducer and the
183
+ output of `pip freeze`.
184
+
185
+ ## License
186
+
187
+ By contributing, you agree that your contributions are licensed under the
188
+ MIT license (see `LICENSE`).
@@ -0,0 +1,239 @@
1
+ Metadata-Version: 2.5
2
+ Name: pybhatlib
3
+ Version: 0.4.0
4
+ Summary: Matrix-based econometric inference in Python: analytic MVNCD evaluation and discrete-choice models
5
+ Project-URL: Homepage, https://github.com/UMN-Choi-Lab/pybhatlib
6
+ Project-URL: Repository, https://github.com/UMN-Choi-Lab/pybhatlib
7
+ Project-URL: Documentation, https://github.com/UMN-Choi-Lab/pybhatlib#readme
8
+ Project-URL: Issues, https://github.com/UMN-Choi-Lab/pybhatlib/issues
9
+ Project-URL: Changelog, https://github.com/UMN-Choi-Lab/pybhatlib/blob/main/CHANGELOG.md
10
+ Author-email: Seongjin Choi <choi@umn.edu>
11
+ License-Expression: MIT
12
+ License-File: LICENSE
13
+ Keywords: MVNCD,covariance matrix,discrete choice,econometrics,multinomial probit,transportation
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: numba>=0.59
23
+ Requires-Dist: numpy>=1.24
24
+ Requires-Dist: pandas>=2.0
25
+ Requires-Dist: scipy>=1.10
26
+ Provides-Extra: all
27
+ Requires-Dist: mypy; extra == 'all'
28
+ Requires-Dist: pytest-cov; extra == 'all'
29
+ Requires-Dist: pytest>=7.0; extra == 'all'
30
+ Requires-Dist: ruff; extra == 'all'
31
+ Requires-Dist: torch>=2.0; extra == 'all'
32
+ Provides-Extra: dev
33
+ Requires-Dist: mypy; extra == 'dev'
34
+ Requires-Dist: pytest-cov; extra == 'dev'
35
+ Requires-Dist: pytest>=7.0; extra == 'dev'
36
+ Requires-Dist: ruff; extra == 'dev'
37
+ Provides-Extra: torch
38
+ Requires-Dist: torch>=2.0; extra == 'torch'
39
+ Description-Content-Type: text/markdown
40
+
41
+ # pybhatlib
42
+
43
+ [![PyPI](https://img.shields.io/pypi/v/pybhatlib)](https://pypi.org/project/pybhatlib/)
44
+ [![Python](https://img.shields.io/pypi/pyversions/pybhatlib)](https://pypi.org/project/pybhatlib/)
45
+ [![Tests](https://img.shields.io/github/actions/workflow/status/UMN-Choi-Lab/pybhatlib/tests.yml?branch=main&label=tests)](https://github.com/UMN-Choi-Lab/pybhatlib/actions/workflows/tests.yml)
46
+ [![License: MIT](https://img.shields.io/pypi/l/pybhatlib)](https://github.com/UMN-Choi-Lab/pybhatlib/blob/main/LICENSE)
47
+
48
+ Open-source Python library for matrix-based econometric inference: multivariate
49
+ normal CDF evaluation with analytic gradients, and maximum-likelihood estimation of
50
+ discrete-choice models (MNP, MORP, MDCEV, MNL).
51
+
52
+ The numerical core follows the GAUSS **BHATLIB** library by Chandra Bhat and
53
+ colleagues (UT Austin / Aptech Systems) and implements Bhat's (2018) analytic
54
+ MVNCD approximation.
55
+
56
+ ## Installation
57
+
58
+ ```bash
59
+ pip install pybhatlib # core (NumPy + SciPy + Numba)
60
+ pip install "pybhatlib[torch]" # add PyTorch backend (optional GPU)
61
+ ```
62
+
63
+ From source (for development, or to run the bundled examples and tutorials):
64
+
65
+ ```bash
66
+ git clone https://github.com/UMN-Choi-Lab/pybhatlib.git
67
+ cd pybhatlib
68
+ pip install -e . # core (NumPy + SciPy + Numba)
69
+ pip install -e ".[torch]" # add PyTorch backend (optional GPU)
70
+ pip install -e ".[dev]" # add pytest, ruff, mypy
71
+ pip install -e ".[all]" # everything (torch + dev)
72
+ ```
73
+
74
+ ## Quick Start — Multinomial Probit (MNP)
75
+
76
+ Sample data: `examples/data/TRAVELMODE.csv` (3 modes — DA / SR / TR, 1125 observations).
77
+
78
+ ```python
79
+ from pybhatlib.models.mnp import MNPModel, MNPControl
80
+
81
+ model = MNPModel(
82
+ data="examples/data/TRAVELMODE.csv",
83
+ alternatives=["Alt1_ch", "Alt2_ch", "Alt3_ch"],
84
+ availability="none",
85
+ spec={
86
+ "CON_SR": {"Alt1_ch": "sero", "Alt2_ch": "uno", "Alt3_ch": "sero"},
87
+ "CON_TR": {"Alt1_ch": "sero", "Alt2_ch": "sero", "Alt3_ch": "uno"},
88
+ "IVTT": {"Alt1_ch": "IVTT_DA", "Alt2_ch": "IVTT_SR", "Alt3_ch": "IVTT_TR"},
89
+ "OVTT": {"Alt1_ch": "OVTT_DA", "Alt2_ch": "OVTT_SR", "Alt3_ch": "OVTT_TR"},
90
+ "COST": {"Alt1_ch": "COST_DA", "Alt2_ch": "COST_SR", "Alt3_ch": "COST_TR"},
91
+ },
92
+ control=MNPControl(iid=True),
93
+ )
94
+ results = model.fit()
95
+ results.summary()
96
+ ```
97
+
98
+ ## Quick Start — Multivariate Ordered Response Probit (MORP)
99
+
100
+ ```python
101
+ from pybhatlib.models.morp import MORPModel, MORPControl
102
+
103
+ model = MORPModel(
104
+ data=df, # DataFrame or CSV path
105
+ dep_vars=["satisfaction", "recommendation"], # ordinal outcome columns
106
+ spec={
107
+ "income": {"satisfaction": "income", "recommendation": "income"},
108
+ "age": {"satisfaction": "age", "recommendation": "age"},
109
+ "education": {"satisfaction": "education", "recommendation": "education"},
110
+ },
111
+ n_categories=[3, 3],
112
+ control=MORPControl(iid=True, seed=42),
113
+ )
114
+ results = model.fit()
115
+ results.summary()
116
+ ```
117
+
118
+ A runnable end-to-end example (with `morp_ate`, `morp_predict`,
119
+ `morp_predict_category`) is at
120
+ [`examples/tutorials/t05b_morp_ate_predict.ipynb`](https://github.com/UMN-Choi-Lab/pybhatlib/blob/main/examples/tutorials/t05b_morp_ate_predict.ipynb).
121
+
122
+ ## Features
123
+
124
+ **Models**
125
+ - **Multinomial Probit (MNP)** — IID, flexible covariance, heteroscedastic-only,
126
+ random coefficients, mixture-of-normals
127
+ - **Multivariate Ordered Response Probit (MORP)** — multiple ordinal outcomes
128
+ with shared covariance; per-outcome `spec` mapping
129
+ - **Multiple Discrete-Continuous Extreme Value (MDCEV)** — traditional
130
+ (Bhat 2008) and linear outside-good utility specifications, selected via
131
+ `MDCEVControl.utility`
132
+ - **Multinomial Logit (MNL)**
133
+ - **Linear regression (LR)** — single continuous outcome, closed-form OLS with
134
+ classical / White-robust / BHHH standard errors
135
+ - **Mixed / simulation-based models** — `MixMNLModel`, `MNPKerCPModel`,
136
+ `MORPFlexModel`, `MDCEVMixedModel` on a shared maximum-simulated-likelihood
137
+ engine (Halton draws, panel data, normal / log-normal / Yeo-Johnson
138
+ coefficient transforms). New and under active refinement.
139
+
140
+ **Numerical core**
141
+ - `vecup` — vecdup, matdupfull, LDLT decomposition, truncated MVN moments
142
+ - `matgradient` — gradcovcor, gomegxomegax, spherical / Cholesky parameterizations
143
+ - `gradmvn` — Bhat (2018) MVNCD analytic approximation with analytic gradients
144
+
145
+ **Estimation**
146
+ - Multiple SE estimators (`se_method="bhhh" | "hessian" | "sandwich"`); BHHH is
147
+ the default to match GAUSS BHATLIB's `_max_CovPar=2`. All three are computed
148
+ at fit time and exposed as `se_bhhh` / `se_hessian` / `se_sandwich`;
149
+ `results.summary()` prints a side-by-side diagnostic block (a large
150
+ Hessian/BHHH divergence is a misspecification signal).
151
+ - `MNPControl.active_mask` to freeze a subset of parameters at their starting
152
+ values without recoding the model.
153
+ - `verbose` levels: `0` silent, `1` summary, `2` per-iteration NLL,
154
+ `3` per-iteration parameter / gradient / relative-gradient table.
155
+
156
+ **Backend**
157
+ - NumPy by default; optional PyTorch backend with GPU support (install with
158
+ `[torch]`). All numerical functions take an optional `xp` kwarg.
159
+
160
+ **Post-estimation**
161
+ - Average Treatment Effects (ATE) with scenario-matrix support, forecasting,
162
+ per-category MORP probability prediction.
163
+ - MORP ATEs from supplied coefficients without re-fitting:
164
+ `MORPResults.from_estimates(beta, thresholds, correlation)` rebuilds a results
165
+ object from natural-space estimates, and `morp_ate_from_params` /
166
+ `morp_joint_probs` (mean joint category-combination probabilities, the GAUSS
167
+ `ate1.csv` equivalent) compute effects directly from them.
168
+
169
+ ## Verification
170
+
171
+ pybhatlib reproduces Table 1 of the BHATLIB GAUSS reference implementation using
172
+ the TRAVELMODE dataset (3 modes — DA, SR, TR; 1125 observations):
173
+
174
+ | Model | Specification | Target LL | Achieved LL | Status |
175
+ |-------|--------------|-----------|-------------|--------|
176
+ | (a)(i) | IID errors | -670.956 | -670.956 | exact match |
177
+ | (a)(ii) | Flexible covariance | -661.111 | -661.111 | exact match |
178
+ | (b) | + AGE45 demographics | -659.285 | -659.284 | exact match |
179
+ | (c) | + Random coeff. OVTT | -635.871 | -635.871 | exact match |
180
+ | (d) | 2-segment mixture | -634.975 | -632.912 | close (multi-modal) |
181
+
182
+ Models (a)–(c) reproduce the GAUSS estimates and BHHH standard errors to ≤0.001
183
+ on every parameter (verified end-to-end against GAUSS 26.1.1 + MaxLik 5.0.9).
184
+ Model (d) is multi-modal — the Python optimum is a slightly better local mode
185
+ than the GAUSS one.
186
+
187
+ For MORP, `iid=False` now uses GAUSS BHATLIB's unit-variance identification by
188
+ default (`MORPControl.fix_scales=True`): the latent-utility variances are fixed
189
+ at 1 and only correlations are estimated. The full-covariance `MORP_DINING` /
190
+ `MORP_WALK` models reproduce the GAUSS mean log-likelihoods (−4.6598 / −3.7591)
191
+ and correlation matrices. `summary()` reports the actual threshold cut-points
192
+ (with delta-method standard errors) and a gradient column, matching GAUSS's
193
+ output. See `docs/plans/MORP_BHATLIB_PARITY.md`.
194
+
195
+ The driving notebooks are
196
+ [`t04h_bhatlib_table1.ipynb`](https://github.com/UMN-Choi-Lab/pybhatlib/blob/main/examples/tutorials/t04h_bhatlib_table1.ipynb) and
197
+ [`t04i_bhat2018_table2.ipynb`](https://github.com/UMN-Choi-Lab/pybhatlib/blob/main/examples/tutorials/t04i_bhat2018_table2.ipynb).
198
+
199
+ ## Tutorials
200
+
201
+ A complete tutorial series lives under
202
+ [`examples/tutorials/`](https://github.com/UMN-Choi-Lab/pybhatlib/tree/main/examples/tutorials/) as Jupyter notebooks (each with a
203
+ matching `.py` script under `python_scripts/`):
204
+
205
+ | Track | Notebooks |
206
+ |-------|-----------|
207
+ | Foundations | `t00_quickstart`, `t01a_vectorization`, `t01b_ldlt`, `t01c_truncated_mvn` |
208
+ | Matrix gradients | `t02a_gradcovcor`, `t02b_spherical`, `t02c_chain_rules` |
209
+ | MVNCD | `t03a_mvncd_methods`, `t03b_mvncd_gradients`, `t03c_mvncd_rect`, `t03d_univariate_cdfs`, `t03e_bhat2018_table1` |
210
+ | MNP | `t04a_mnp_iid` … `t04g_mnp_forecasting`, `t04h_bhatlib_table1`, `t04i_bhat2018_table2` |
211
+ | MORP | `t05b_morp_ate_predict` |
212
+ | MDCEV | `t07a_mdcev_trad`, `t07b_mdcev_lin` |
213
+ | MNL | `t08a_mnl` |
214
+ | LR | `t09a_lr` |
215
+ | Backends & verification | `t06a_backend_switching`, `t06b_custom_specs`, `t06c_gradient_verification` |
216
+
217
+ ## Contributing
218
+
219
+ See [`CONTRIBUTING.md`](https://github.com/UMN-Choi-Lab/pybhatlib/blob/main/CONTRIBUTING.md) for development setup, the PR-test
220
+ workflow, and CODEOWNERS conventions. Key tests:
221
+
222
+ ```bash
223
+ pytest tests/ # full suite
224
+ pytest tests/ -m "not slow" # skip integration tests
225
+ pytest tests/ -m torch # PyTorch backend tests only
226
+ ```
227
+
228
+ ## References
229
+
230
+ 1. Bhat, C. R. (2018). New Matrix-Based Methods for the Analytic Evaluation of the
231
+ Multivariate Cumulative Normal Distribution Function. *Transportation Research
232
+ Part B*, 109: 238–256.
233
+ 2. Bhat, C. R. (2008). The Multiple Discrete-Continuous Extreme Value (MDCEV)
234
+ Model: Role of Utility Function Parameters, Identification Considerations, and
235
+ Model Extensions. *Transportation Research Part B*, 42(3): 274–303.
236
+
237
+ ## License
238
+
239
+ MIT