pybhatlib 0.2.0__tar.gz → 0.3.1__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.
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/.gitignore +8 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/PKG-INFO +17 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/README.md +16 -0
- pybhatlib-0.3.1/examples/data/TRAVELMODE.csv +1126 -0
- pybhatlib-0.3.1/examples/mnp_age45.py +45 -0
- pybhatlib-0.3.1/examples/mnp_mixture.py +51 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t00_quickstart.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t01a_vectorization.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t01b_ldlt.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t01c_truncated_mvn.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t02a_gradcovcor.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t02b_spherical.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t02c_chain_rules.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t03a_mvncd_methods.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t03b_mvncd_gradients.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t03c_mvncd_rect.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t03d_univariate_cdfs.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t03e_bhat2018_table1.py +368 -366
- pybhatlib-0.3.1/examples/tutorials/python_scripts/t04a_mnp_iid.py +183 -0
- pybhatlib-0.3.1/examples/tutorials/python_scripts/t04b_mnp_flexible_cov.py +194 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t04c_mnp_heteronly.py +2 -0
- pybhatlib-0.3.1/examples/tutorials/python_scripts/t04d_mnp_random_coefficients.py +232 -0
- pybhatlib-0.3.1/examples/tutorials/python_scripts/t04e_mnp_mixture.py +209 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t04f_mnp_control_options.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t04g_mnp_forecasting.py +2 -0
- pybhatlib-0.3.1/examples/tutorials/python_scripts/t04h_bhatlib_table1.py +447 -0
- pybhatlib-0.3.1/examples/tutorials/python_scripts/t04i_bhat2018_table2.py +609 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t05b_morp_ate_predict.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t06a_backend_switching.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t06b_custom_specs.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/python_scripts/t06c_gradient_verification.py +2 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t00_quickstart.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t01a_vectorization.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t01b_ldlt.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t01c_truncated_mvn.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t02a_gradcovcor.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t02b_spherical.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t02c_chain_rules.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t03a_mvncd_methods.ipynb +2 -2
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t03b_mvncd_gradients.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t03c_mvncd_rect.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t03d_univariate_cdfs.ipynb +1 -1
- pybhatlib-0.3.1/examples/tutorials/t03e_bhat2018_table1.ipynb +44 -0
- pybhatlib-0.3.1/examples/tutorials/t04a_mnp_iid.ipynb +99 -0
- pybhatlib-0.3.1/examples/tutorials/t04b_mnp_flexible_cov.ipynb +115 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t04c_mnp_heteronly.ipynb +1 -1
- pybhatlib-0.3.1/examples/tutorials/t04d_mnp_random_coefficients.ipynb +99 -0
- pybhatlib-0.3.1/examples/tutorials/t04e_mnp_mixture.ipynb +99 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t04f_mnp_control_options.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t04g_mnp_forecasting.ipynb +1 -1
- pybhatlib-0.3.1/examples/tutorials/t04h_bhatlib_table1.ipynb +163 -0
- pybhatlib-0.3.1/examples/tutorials/t04i_bhat2018_table2.ipynb +163 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t05b_morp_ate_predict.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t06a_backend_switching.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t06b_custom_specs.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/t06c_gradient_verification.ipynb +1 -1
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/pyproject.toml +1 -1
- pybhatlib-0.3.1/src/pybhatlib/gradmvn/__init__.py +52 -0
- pybhatlib-0.3.1/src/pybhatlib/gradmvn/_cond_trunc_grads.py +471 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/gradmvn/_mvncd.py +194 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/gradmvn/_mvncd_grad.py +28 -15
- pybhatlib-0.3.1/src/pybhatlib/gradmvn/_mvncd_grad_analytic.py +255 -0
- pybhatlib-0.3.1/src/pybhatlib/gradmvn/_ordering.py +143 -0
- pybhatlib-0.3.1/src/pybhatlib/gradmvn/_trunc_grads.py +562 -0
- pybhatlib-0.3.1/src/pybhatlib/gradmvn/_univariate.py +335 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/matgradient/__init__.py +3 -0
- pybhatlib-0.3.1/src/pybhatlib/matgradient/_mat_grad_helpers.py +325 -0
- pybhatlib-0.3.1/src/pybhatlib/matgradient/_radial.py +181 -0
- pybhatlib-0.3.1/src/pybhatlib/matgradient/_spherical.py +252 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/mnp/_mnp_ate.py +3 -4
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/mnp/_mnp_control.py +1 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/mnp/_mnp_forecast.py +1 -1
- pybhatlib-0.3.1/src/pybhatlib/models/mnp/_mnp_grad_analytic.py +386 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/mnp/_mnp_loglik.py +19 -9
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/mnp/_mnp_model.py +277 -40
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/mnp/_mnp_results.py +8 -5
- pybhatlib-0.3.1/tests/test_gradmvn/test_cond_trunc_grads.py +492 -0
- pybhatlib-0.3.1/tests/test_gradmvn/test_mvncd_grad_analytic.py +302 -0
- pybhatlib-0.3.1/tests/test_gradmvn/test_ordering.py +277 -0
- pybhatlib-0.3.1/tests/test_gradmvn/test_trunc_grads.py +473 -0
- pybhatlib-0.3.1/tests/test_matgradient/test_mat_grad_helpers.py +359 -0
- pybhatlib-0.3.1/tests/test_matgradient/test_radial.py +218 -0
- pybhatlib-0.3.1/tests/test_matgradient/test_spherical.py +244 -0
- pybhatlib-0.3.1/tests/test_models/test_mnp_grad.py +586 -0
- pybhatlib-0.2.0/CLAUDE.md +0 -42
- pybhatlib-0.2.0/IMPLEMENTATION_PLAN.md +0 -497
- pybhatlib-0.2.0/src/pybhatlib/gradmvn/__init__.py +0 -24
- pybhatlib-0.2.0/src/pybhatlib/gradmvn/_univariate.py +0 -193
- pybhatlib-0.2.0/src/pybhatlib/matgradient/_spherical.py +0 -190
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/LICENSE +0 -0
- /pybhatlib-0.2.0/examples/data/TRAVELMODE.csv → /pybhatlib-0.3.1/examples/data/TRAVELMODE_synthetic.csv +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/data/generate_travelmode.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/mnp_ate_analysis.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/mnp_flexible_cov.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/mnp_iid.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/mnp_random_coefficients.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/morp_example.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/examples/tutorials/_convert_to_ipynb.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/_version.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/backend/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/backend/_array_api.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/backend/_numpy_backend.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/backend/_torch_backend.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/gradmvn/_bivariate_trunc.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/gradmvn/_mvncd_ssj.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/gradmvn/_other_dists.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/gradmvn/_partial_cdf.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/gradmvn/_truncated.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/io/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/io/_data_loader.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/io/_spec_parser.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/matgradient/_chain_rules.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/matgradient/_gomegxomegax.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/matgradient/_gradcovcor.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/_base.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/mnp/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/morp/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/morp/_morp_ate.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/morp/_morp_control.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/morp/_morp_forecast.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/morp/_morp_loglik.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/morp/_morp_model.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/models/morp/_morp_results.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/optim/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/optim/_convergence.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/optim/_scipy_optim.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/optim/_torch_optim.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/utils/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/utils/_qmc.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/utils/_seeds.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/utils/_validation.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/vecup/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/vecup/_ldlt.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/vecup/_mask.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/vecup/_nondiag.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/vecup/_truncnorm.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/src/pybhatlib/vecup/_vec_ops.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/conftest.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_backend/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_backend/test_array_api.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_gradmvn/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_gradmvn/test_bivariate_trunc.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_gradmvn/test_mvncd.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_gradmvn/test_mvncd_methods.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_gradmvn/test_mvncd_rect.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_gradmvn/test_other_dists.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_integration/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_matgradient/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_matgradient/test_gradcovcor.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_models/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_models/test_mnp_control.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_models/test_morp.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_vecup/__init__.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_vecup/test_ldlt.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_vecup/test_ldlt_rank2.py +0 -0
- {pybhatlib-0.2.0 → pybhatlib-0.3.1}/tests/test_vecup/test_vec_ops.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pybhatlib
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: Python implementation of BHATLIB: matrix-based inference for advanced econometric models
|
|
5
5
|
Project-URL: Homepage, https://github.com/UMN-Choi-Lab/pybhatlib
|
|
6
6
|
Project-URL: Repository, https://github.com/UMN-Choi-Lab/pybhatlib
|
|
@@ -96,6 +96,22 @@ results.summary()
|
|
|
96
96
|
- **Dual backend**: NumPy (default) + optional PyTorch with GPU support
|
|
97
97
|
- **Post-estimation**: Average Treatment Effects (ATE), forecasting
|
|
98
98
|
|
|
99
|
+
## Verification
|
|
100
|
+
|
|
101
|
+
pybhatlib reproduces Table 1 from the BHATLIB paper (Bhat 2018) using synthetic
|
|
102
|
+
TRAVELMODE data with 3 travel modes (DA, SR, TR) and 210 observations:
|
|
103
|
+
|
|
104
|
+
| Model | Specification | Target LL | Achieved LL | Status |
|
|
105
|
+
|-------|--------------|-----------|-------------|--------|
|
|
106
|
+
| (a)(i) | IID errors | -670.956 | -670.956 | Exact match |
|
|
107
|
+
| (a)(ii) | Flexible covariance | -661.111 | -661.111 | Exact match |
|
|
108
|
+
| (b) | + AGE45 demographics | -659.285 | -659.284 | Exact match |
|
|
109
|
+
| (c) | + Random coeff. OVTT | -635.871 | -635.871 | Exact match |
|
|
110
|
+
| (d) | 2-segment mixture | -634.975 | -632.912 | Close (synthetic data) |
|
|
111
|
+
|
|
112
|
+
Models (a)–(c) match the published results exactly. Model (d) achieves a slightly
|
|
113
|
+
better log-likelihood due to multiple local optima in mixture models with synthetic data.
|
|
114
|
+
|
|
99
115
|
## References
|
|
100
116
|
|
|
101
117
|
1. Bhat, C. R. (2018). New Matrix-Based Methods for the Analytic Evaluation of the
|
|
@@ -58,6 +58,22 @@ results.summary()
|
|
|
58
58
|
- **Dual backend**: NumPy (default) + optional PyTorch with GPU support
|
|
59
59
|
- **Post-estimation**: Average Treatment Effects (ATE), forecasting
|
|
60
60
|
|
|
61
|
+
## Verification
|
|
62
|
+
|
|
63
|
+
pybhatlib reproduces Table 1 from the BHATLIB paper (Bhat 2018) using synthetic
|
|
64
|
+
TRAVELMODE data with 3 travel modes (DA, SR, TR) and 210 observations:
|
|
65
|
+
|
|
66
|
+
| Model | Specification | Target LL | Achieved LL | Status |
|
|
67
|
+
|-------|--------------|-----------|-------------|--------|
|
|
68
|
+
| (a)(i) | IID errors | -670.956 | -670.956 | Exact match |
|
|
69
|
+
| (a)(ii) | Flexible covariance | -661.111 | -661.111 | Exact match |
|
|
70
|
+
| (b) | + AGE45 demographics | -659.285 | -659.284 | Exact match |
|
|
71
|
+
| (c) | + Random coeff. OVTT | -635.871 | -635.871 | Exact match |
|
|
72
|
+
| (d) | 2-segment mixture | -634.975 | -632.912 | Close (synthetic data) |
|
|
73
|
+
|
|
74
|
+
Models (a)–(c) match the published results exactly. Model (d) achieves a slightly
|
|
75
|
+
better log-likelihood due to multiple local optima in mixture models with synthetic data.
|
|
76
|
+
|
|
61
77
|
## References
|
|
62
78
|
|
|
63
79
|
1. Bhat, C. R. (2018). New Matrix-Based Methods for the Analytic Evaluation of the
|