Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New function: inverse_lagrange_multiplier_test. #88

Merged
merged 9 commits into from
Jul 5, 2024
Merged

Conversation

mlondschien
Copy link
Owner

Slightly faster:

main:

[83.33%] ··· tests.Tests.time_lagrange_multiplier_test                                                                                                                  ok
[83.33%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000    145±0.4μs        43.8±5ms      2.45±0.02ms         2.79±0.02ms      
             ====== ============== ================ ============== =======================

here:

[83.33%] ··· tests.Tests.time_lagrange_multiplier_test                                                                                                                  ok
[83.33%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     142±2μs         28.7±6ms      1.95±0.02ms         2.55±0.04ms      
             ====== ============== ================ ============== =======================

Copy link

codecov bot commented Jul 3, 2024

Codecov Report

Attention: Patch coverage is 88.47584% with 31 lines in your changes missing coverage. Please review.

Project coverage is 92.20%. Comparing base (5a0390c) to head (2674d59).
Report is 30 commits behind head on main.

Files with missing lines Patch % Lines
ivmodels/confidence_set.py 48.14% 14 Missing ⚠️
tests/tests/test_tests.py 79.48% 8 Missing ⚠️
ivmodels/tests/lagrange_multiplier.py 95.36% 7 Missing ⚠️
ivmodels/quadric.py 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
- Coverage   93.25%   92.20%   -1.05%     
==========================================
  Files          32       33       +1     
  Lines        1615     1821     +206     
==========================================
+ Hits         1506     1679     +173     
- Misses        109      142      +33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mlondschien
Copy link
Owner Author

(ivmodels) (base) code/ivmodels/benchmarks [inverse_lm] $ asv run -m macbook-malte --python=same
Couldn't load asv.plugins._mamba_helpers because
No module named 'libmambapy'
· Discovering benchmarks
· Running 14 total benchmarks (1 commits * 1 environments * 14 benchmarks)
[ 0.00%] ·· Benchmarking existing-py_Users_mlondschien_mambaforge_envs_ivmodels_bin_python
[ 3.57%] ··· Running (kclass.KClass.time_fit--).....
[21.43%] ··· Running (tests.Tests.time_inverse_anderson_rubin_test--).....
[39.29%] ··· Running (tests.Tests.time_lagrange_multiplier_test--)....
[53.57%] ··· kclass.KClass.time_fit                                                                                                                                                                         ok
[53.57%] ··· ======= ================= =================== ================= =======================
             --                                            data                                     
             ------- -------------------------------------------------------------------------------
              kappa   (1000, 1, 1, 0)   (1000, 2, 100, 0)   (1000, 2, 4, 2)   guggenberger12 (k=10) 
             ======= ================= =================== ================= =======================
               liml       147±2μs            4.98±2ms           327±7μs              286±20μs       
               tsls     1.37±0.02ms          8.29±2ms         1.63±0.08ms          1.68±0.06ms      
               0.5      1.40±0.08ms          7.94±1ms         1.59±0.05ms          1.61±0.03ms      
             ======= ================= =================== ================= =======================

[57.14%] ··· tests.Tests.time_anderson_rubin_test                                                                                                                                                           ok
[57.14%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     105±1μs         9.15±3ms        308±10μs            331±6μs        
             ====== ============== ================ ============== =======================

[60.71%] ··· tests.Tests.time_anderson_rubin_test_guggenberger19                                                                                                                                            ok
[60.71%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000       n/a           26.3±8ms        422±10μs            560±20μs       
             ====== ============== ================ ============== =======================

[64.29%] ··· tests.Tests.time_conditional_likelihood_ratio_test_numerical_integration                                                                                                                       ok
[64.29%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     491±10μs        30.3±7ms        917±8μs             653±20μs       
             ====== ============== ================ ============== =======================

[67.86%] ··· tests.Tests.time_conditional_likelihood_ratio_test_power_series                                                                                                                                ok
[67.86%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     465±3μs        2.06±0.04s       981±60μs          2.64±0.04ms      
             ====== ============== ================ ============== =======================

[71.43%] ··· tests.Tests.time_inverse_anderson_rubin_test                                                                                                                                                   ok
[71.43%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     292±2μs         10.3±6ms        666±20μs            603±10μs       
             ====== ============== ================ ============== =======================

[75.00%] ··· tests.Tests.time_inverse_lagrange_multiplier_test                                                                                                                                              ok
[75.00%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000    9.35±0.2ms      1.96±0.03s         n/a               139±2ms        
             ====== ============== ================ ============== =======================

[78.57%] ··· tests.Tests.time_inverse_likelihood_ratio_test                                                                                                                                                 ok
[78.57%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     323±10μs        16.9±3ms        694±7μs             675±5μs        
             ====== ============== ================ ============== =======================

[82.14%] ··· tests.Tests.time_inverse_wald_test_liml                                                                                                                                                        ok
[82.14%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     564±30μs       24.7±20ms      1.16±0.06ms           913±8μs        
             ====== ============== ================ ============== =======================

[85.71%] ··· tests.Tests.time_inverse_wald_test_tsls                                                                                                                                                        ok
[85.71%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000    1.82±0.1ms      41.9±20ms      2.50±0.03ms          2.63±0.1ms      
             ====== ============== ================ ============== =======================

[89.29%] ··· tests.Tests.time_lagrange_multiplier_test                                                                                                                                                      ok
[89.29%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     146±3μs        49.9±10ms      4.36±0.09ms          4.42±0.2ms      
             ====== ============== ================ ============== =======================

[92.86%] ··· tests.Tests.time_likelihood_ratio_test                                                                                                                                                         ok
[92.86%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000    152±0.8μs        12.8±4ms        377±10μs            375±10μs       
             ====== ============== ================ ============== =======================

[96.43%] ··· tests.Tests.time_wald_test_liml                                                                                                                                                                ok
[96.43%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     351±6μs         22.5±6ms        817±20μs            923±80μs       
             ====== ============== ================ ============== =======================

[100.00%] ··· tests.Tests.time_wald_test_tsls                                                                                                                                                                ok
[100.00%] ··· ====== ============== ================ ============== =======================
              --                                      data                                 
              ------ ----------------------------------------------------------------------
                n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
              ====== ============== ================ ============== =======================
               1000   1.59±0.02ms       20.1±8ms      2.13±0.02ms          2.35±0.1ms      
              ====== ============== ================ ============== =======================

@mlondschien mlondschien changed the title New class: _LM New function: inverse_lagrange_multiplier_test. Jul 5, 2024
@mlondschien
Copy link
Owner Author

[75.00%] ··· tests.Tests.time_inverse_lagrange_multiplier_test                                                                                                                                              ok
[75.00%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000   9.25±0.06ms      2.17±0.02s         n/a               169±1ms        
             ====== ============== ================ ============== =======================
[89.29%] ··· tests.Tests.time_lagrange_multiplier_test                                                                                                                                                      ok
[89.29%] ··· ====== ============== ================ ============== =======================
             --                                      data                                 
             ------ ----------------------------------------------------------------------
               n     (1, 1, 0, 0)   (100, 1, 4, 0)   (4, 2, 2, 2)   guggenberger12 (k=10) 
             ====== ============== ================ ============== =======================
              1000     146±3μs         36.7±4ms      4.73±0.04ms         4.82±0.05ms      
             ====== ============== ================ ============== =======================

@mlondschien mlondschien merged commit bf6fd08 into main Jul 5, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant