inferust 0.1.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 (195) hide show
  1. inferust-0.1.0/.github/workflows/ci.yml +79 -0
  2. inferust-0.1.0/.github/workflows/publish.yml +45 -0
  3. inferust-0.1.0/.gitignore +15 -0
  4. inferust-0.1.0/CHANGELOG.md +694 -0
  5. inferust-0.1.0/Cargo.lock +3795 -0
  6. inferust-0.1.0/Cargo.toml +124 -0
  7. inferust-0.1.0/EXAMPLES.md +311 -0
  8. inferust-0.1.0/LICENSE +21 -0
  9. inferust-0.1.0/PKG-INFO +46 -0
  10. inferust-0.1.0/README.md +240 -0
  11. inferust-0.1.0/bench/Dockerfile.python +4 -0
  12. inferust-0.1.0/bench/Dockerfile.rust +9 -0
  13. inferust-0.1.0/bench/README.md +35 -0
  14. inferust-0.1.0/docs/parity.md +300 -0
  15. inferust-0.1.0/examples/basic_ols.rs +98 -0
  16. inferust-0.1.0/examples/bench_all.rs +455 -0
  17. inferust-0.1.0/examples/bench_ols.rs +127 -0
  18. inferust-0.1.0/examples/bench_smoke.rs +87 -0
  19. inferust-0.1.0/examples/case_studies.rs +475 -0
  20. inferust-0.1.0/examples/diagnostics.rs +29 -0
  21. inferust-0.1.0/examples/discrete_models.rs +35 -0
  22. inferust-0.1.0/pyproject.toml +20 -0
  23. inferust-0.1.0/python/Cargo.lock +467 -0
  24. inferust-0.1.0/python/Cargo.toml +14 -0
  25. inferust-0.1.0/python/README.md +34 -0
  26. inferust-0.1.0/python/src/lib.rs +252 -0
  27. inferust-0.1.0/scripts/bench_all_statsmodels.py +165 -0
  28. inferust-0.1.0/scripts/bench_statsmodels.py +59 -0
  29. inferust-0.1.0/scripts/parity_statsmodels.py +3007 -0
  30. inferust-0.1.0/scripts/stl_reference.py +233 -0
  31. inferust-0.1.0/src/contingency.rs +181 -0
  32. inferust-0.1.0/src/correlation.rs +110 -0
  33. inferust-0.1.0/src/covariance.rs +276 -0
  34. inferust-0.1.0/src/data.rs +1360 -0
  35. inferust-0.1.0/src/descriptive.rs +110 -0
  36. inferust-0.1.0/src/diagnostics.rs +161 -0
  37. inferust-0.1.0/src/discrete.rs +1733 -0
  38. inferust-0.1.0/src/error.rs +18 -0
  39. inferust-0.1.0/src/evaluation.rs +193 -0
  40. inferust-0.1.0/src/gam.rs +667 -0
  41. inferust-0.1.0/src/gee.rs +416 -0
  42. inferust-0.1.0/src/glm.rs +2974 -0
  43. inferust-0.1.0/src/glm_family.rs +213 -0
  44. inferust-0.1.0/src/gmm.rs +357 -0
  45. inferust-0.1.0/src/graphics.rs +372 -0
  46. inferust-0.1.0/src/hypothesis/anova.rs +353 -0
  47. inferust-0.1.0/src/hypothesis/chisq.rs +116 -0
  48. inferust-0.1.0/src/hypothesis/mod.rs +12 -0
  49. inferust-0.1.0/src/hypothesis/multicomp.rs +313 -0
  50. inferust-0.1.0/src/hypothesis/nonparametric.rs +1076 -0
  51. inferust-0.1.0/src/hypothesis/ttest.rs +158 -0
  52. inferust-0.1.0/src/hypothesis/tukey.rs +460 -0
  53. inferust-0.1.0/src/hypothesis/wald.rs +179 -0
  54. inferust-0.1.0/src/imputation.rs +214 -0
  55. inferust-0.1.0/src/irls.rs +72 -0
  56. inferust-0.1.0/src/lib.rs +133 -0
  57. inferust-0.1.0/src/mixed.rs +887 -0
  58. inferust-0.1.0/src/multivariate.rs +297 -0
  59. inferust-0.1.0/src/panel.rs +802 -0
  60. inferust-0.1.0/src/plot.rs +777 -0
  61. inferust-0.1.0/src/polars_bridge.rs +54 -0
  62. inferust-0.1.0/src/post_estimation.rs +638 -0
  63. inferust-0.1.0/src/power.rs +570 -0
  64. inferust-0.1.0/src/proportion.rs +300 -0
  65. inferust-0.1.0/src/regression/gls.rs +638 -0
  66. inferust-0.1.0/src/regression/mod.rs +11 -0
  67. inferust-0.1.0/src/regression/ols.rs +1575 -0
  68. inferust-0.1.0/src/regression/quantile.rs +520 -0
  69. inferust-0.1.0/src/regression/regularized.rs +657 -0
  70. inferust-0.1.0/src/regression/rolling.rs +496 -0
  71. inferust-0.1.0/src/robust.rs +328 -0
  72. inferust-0.1.0/src/seasonal.rs +535 -0
  73. inferust-0.1.0/src/smoothing.rs +754 -0
  74. inferust-0.1.0/src/statespace/kalman.rs +396 -0
  75. inferust-0.1.0/src/statespace/mod.rs +11 -0
  76. inferust-0.1.0/src/statespace/scalar.rs +274 -0
  77. inferust-0.1.0/src/survival.rs +857 -0
  78. inferust-0.1.0/src/time_series.rs +4571 -0
  79. inferust-0.1.0/src/treatment.rs +230 -0
  80. inferust-0.1.0/tests/common/mod.rs +105 -0
  81. inferust-0.1.0/tests/fixtures/statsmodels/README.md +19 -0
  82. inferust-0.1.0/tests/fixtures/statsmodels/acf_pacf.json +361 -0
  83. inferust-0.1.0/tests/fixtures/statsmodels/adf.json +317 -0
  84. inferust-0.1.0/tests/fixtures/statsmodels/anderson_darling.json +74 -0
  85. inferust-0.1.0/tests/fixtures/statsmodels/anova_oneway.json +106 -0
  86. inferust-0.1.0/tests/fixtures/statsmodels/anova_twoway.json +198 -0
  87. inferust-0.1.0/tests/fixtures/statsmodels/arima_ar1.json +321 -0
  88. inferust-0.1.0/tests/fixtures/statsmodels/arima_arma11.json +323 -0
  89. inferust-0.1.0/tests/fixtures/statsmodels/breusch_pagan.json +314 -0
  90. inferust-0.1.0/tests/fixtures/statsmodels/chi2_goodness_of_fit.json +24 -0
  91. inferust-0.1.0/tests/fixtures/statsmodels/chi2_independence.json +26 -0
  92. inferust-0.1.0/tests/fixtures/statsmodels/cox_ph.json +1026 -0
  93. inferust-0.1.0/tests/fixtures/statsmodels/descriptive.json +219 -0
  94. inferust-0.1.0/tests/fixtures/statsmodels/elastic_net_small.json +500 -0
  95. inferust-0.1.0/tests/fixtures/statsmodels/engle_granger.json +417 -0
  96. inferust-0.1.0/tests/fixtures/statsmodels/fgls_cochrane_orcutt.json +318 -0
  97. inferust-0.1.0/tests/fixtures/statsmodels/forecast_ci.json +692 -0
  98. inferust-0.1.0/tests/fixtures/statsmodels/gam_penalized_gcv.json +276 -0
  99. inferust-0.1.0/tests/fixtures/statsmodels/gam_small.json +271 -0
  100. inferust-0.1.0/tests/fixtures/statsmodels/gamma_glm.json +1712 -0
  101. inferust-0.1.0/tests/fixtures/statsmodels/gee_poisson.json +1236 -0
  102. inferust-0.1.0/tests/fixtures/statsmodels/gee_small.json +754 -0
  103. inferust-0.1.0/tests/fixtures/statsmodels/gls_ar1.json +1915 -0
  104. inferust-0.1.0/tests/fixtures/statsmodels/granger_causality.json +313 -0
  105. inferust-0.1.0/tests/fixtures/statsmodels/holt_winters.json +274 -0
  106. inferust-0.1.0/tests/fixtures/statsmodels/imputation_mice_small.json +140 -0
  107. inferust-0.1.0/tests/fixtures/statsmodels/inverse_gaussian_glm.json +779 -0
  108. inferust-0.1.0/tests/fixtures/statsmodels/iv2sls_small.json +583 -0
  109. inferust-0.1.0/tests/fixtures/statsmodels/kaplan_meier.json +187 -0
  110. inferust-0.1.0/tests/fixtures/statsmodels/kruskal_wallis_parity.json +92 -0
  111. inferust-0.1.0/tests/fixtures/statsmodels/ks_one_sample.json +73 -0
  112. inferust-0.1.0/tests/fixtures/statsmodels/ks_two_sample.json +99 -0
  113. inferust-0.1.0/tests/fixtures/statsmodels/lasso_small.json +500 -0
  114. inferust-0.1.0/tests/fixtures/statsmodels/lilliefors.json +51 -0
  115. inferust-0.1.0/tests/fixtures/statsmodels/log_rank.json +258 -0
  116. inferust-0.1.0/tests/fixtures/statsmodels/logit_small.json +1259 -0
  117. inferust-0.1.0/tests/fixtures/statsmodels/mann_whitney.json +97 -0
  118. inferust-0.1.0/tests/fixtures/statsmodels/manova.json +261 -0
  119. inferust-0.1.0/tests/fixtures/statsmodels/mcnemar.json +18 -0
  120. inferust-0.1.0/tests/fixtures/statsmodels/mixed_small.json +759 -0
  121. inferust-0.1.0/tests/fixtures/statsmodels/multicomp.json +178 -0
  122. inferust-0.1.0/tests/fixtures/statsmodels/multinomial_small.json +1243 -0
  123. inferust-0.1.0/tests/fixtures/statsmodels/negbin_small.json +1240 -0
  124. inferust-0.1.0/tests/fixtures/statsmodels/odds_ratio.json +19 -0
  125. inferust-0.1.0/tests/fixtures/statsmodels/ols_hc0.json +1237 -0
  126. inferust-0.1.0/tests/fixtures/statsmodels/ols_hc1.json +1237 -0
  127. inferust-0.1.0/tests/fixtures/statsmodels/ols_hc2.json +1237 -0
  128. inferust-0.1.0/tests/fixtures/statsmodels/ols_hc3.json +1237 -0
  129. inferust-0.1.0/tests/fixtures/statsmodels/ols_medium.json +5293 -0
  130. inferust-0.1.0/tests/fixtures/statsmodels/ols_small.json +737 -0
  131. inferust-0.1.0/tests/fixtures/statsmodels/ordered_logit_small.json +1031 -0
  132. inferust-0.1.0/tests/fixtures/statsmodels/panel_fe.json +616 -0
  133. inferust-0.1.0/tests/fixtures/statsmodels/panel_re.json +631 -0
  134. inferust-0.1.0/tests/fixtures/statsmodels/panel_time_fe.json +706 -0
  135. inferust-0.1.0/tests/fixtures/statsmodels/panel_two_way_fe.json +678 -0
  136. inferust-0.1.0/tests/fixtures/statsmodels/pca.json +644 -0
  137. inferust-0.1.0/tests/fixtures/statsmodels/pearson_spearman.json +174 -0
  138. inferust-0.1.0/tests/fixtures/statsmodels/poisson_small.json +1442 -0
  139. inferust-0.1.0/tests/fixtures/statsmodels/power.json +78 -0
  140. inferust-0.1.0/tests/fixtures/statsmodels/probit_small.json +1239 -0
  141. inferust-0.1.0/tests/fixtures/statsmodels/proportion.json +49 -0
  142. inferust-0.1.0/tests/fixtures/statsmodels/quantreg_median.json +419 -0
  143. inferust-0.1.0/tests/fixtures/statsmodels/quantreg_q25.json +419 -0
  144. inferust-0.1.0/tests/fixtures/statsmodels/recursive_ols.json +276 -0
  145. inferust-0.1.0/tests/fixtures/statsmodels/reset_test.json +414 -0
  146. inferust-0.1.0/tests/fixtures/statsmodels/ridge_small.json +500 -0
  147. inferust-0.1.0/tests/fixtures/statsmodels/robust_small.json +532 -0
  148. inferust-0.1.0/tests/fixtures/statsmodels/rolling_ols.json +563 -0
  149. inferust-0.1.0/tests/fixtures/statsmodels/sarimax_exact_mle.json +776 -0
  150. inferust-0.1.0/tests/fixtures/statsmodels/sarimax_small.json +327 -0
  151. inferust-0.1.0/tests/fixtures/statsmodels/seasonal_decompose.json +986 -0
  152. inferust-0.1.0/tests/fixtures/statsmodels/shapiro_wilk.json +51 -0
  153. inferust-0.1.0/tests/fixtures/statsmodels/sign_test.json +74 -0
  154. inferust-0.1.0/tests/fixtures/statsmodels/stl.json +882 -0
  155. inferust-0.1.0/tests/fixtures/statsmodels/treatment_ipw_small.json +589 -0
  156. inferust-0.1.0/tests/fixtures/statsmodels/ttest_1samp.json +97 -0
  157. inferust-0.1.0/tests/fixtures/statsmodels/ttest_ind.json +123 -0
  158. inferust-0.1.0/tests/fixtures/statsmodels/tukey_hsd.json +88 -0
  159. inferust-0.1.0/tests/fixtures/statsmodels/varmax_exact_mle.json +1065 -0
  160. inferust-0.1.0/tests/fixtures/statsmodels/varmax_small.json +280 -0
  161. inferust-0.1.0/tests/fixtures/statsmodels/vecm_small.json +209 -0
  162. inferust-0.1.0/tests/fixtures/statsmodels/vif.json +315 -0
  163. inferust-0.1.0/tests/fixtures/statsmodels/wald_ols.json +878 -0
  164. inferust-0.1.0/tests/fixtures/statsmodels/white_test.json +314 -0
  165. inferust-0.1.0/tests/fixtures/statsmodels/wilcoxon.json +92 -0
  166. inferust-0.1.0/tests/fixtures/statsmodels/wls_small.json +759 -0
  167. inferust-0.1.0/tests/fixtures/statsmodels/zip_small.json +1035 -0
  168. inferust-0.1.0/tests/parity_contingency.rs +88 -0
  169. inferust-0.1.0/tests/parity_correlation.rs +32 -0
  170. inferust-0.1.0/tests/parity_descriptive.rs +33 -0
  171. inferust-0.1.0/tests/parity_diagnostics.rs +119 -0
  172. inferust-0.1.0/tests/parity_discrete.rs +174 -0
  173. inferust-0.1.0/tests/parity_gam.rs +76 -0
  174. inferust-0.1.0/tests/parity_gee.rs +103 -0
  175. inferust-0.1.0/tests/parity_glm.rs +219 -0
  176. inferust-0.1.0/tests/parity_glm_family.rs +154 -0
  177. inferust-0.1.0/tests/parity_gmm.rs +40 -0
  178. inferust-0.1.0/tests/parity_hypothesis.rs +620 -0
  179. inferust-0.1.0/tests/parity_imputation.rs +72 -0
  180. inferust-0.1.0/tests/parity_mixed.rs +57 -0
  181. inferust-0.1.0/tests/parity_multivariate.rs +111 -0
  182. inferust-0.1.0/tests/parity_ols.rs +241 -0
  183. inferust-0.1.0/tests/parity_panel.rs +227 -0
  184. inferust-0.1.0/tests/parity_power.rs +141 -0
  185. inferust-0.1.0/tests/parity_proportion.rs +121 -0
  186. inferust-0.1.0/tests/parity_regression_gls.rs +90 -0
  187. inferust-0.1.0/tests/parity_regression_quantile.rs +49 -0
  188. inferust-0.1.0/tests/parity_regression_rolling.rs +103 -0
  189. inferust-0.1.0/tests/parity_regularized.rs +91 -0
  190. inferust-0.1.0/tests/parity_robust.rs +49 -0
  191. inferust-0.1.0/tests/parity_seasonal.rs +161 -0
  192. inferust-0.1.0/tests/parity_smoothing.rs +143 -0
  193. inferust-0.1.0/tests/parity_survival.rs +141 -0
  194. inferust-0.1.0/tests/parity_timeseries.rs +589 -0
  195. inferust-0.1.0/tests/parity_treatment.rs +58 -0
@@ -0,0 +1,79 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ build-and-test:
14
+ name: Build & Test
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - uses: actions/checkout@v5
19
+
20
+ - name: Install stable Rust
21
+ uses: dtolnay/rust-toolchain@stable
22
+ with:
23
+ components: rustfmt, clippy
24
+
25
+ - name: Cache cargo registry
26
+ uses: actions/cache@v5
27
+ with:
28
+ path: |
29
+ ~/.cargo/registry
30
+ ~/.cargo/git
31
+ target
32
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
33
+
34
+ - name: Check formatting
35
+ run: cargo fmt --all --check
36
+
37
+ # --all-targets covers tests, examples and benches; --all-features covers
38
+ # the optional polars bridge, which a default-feature lint would skip.
39
+ - name: Clippy
40
+ run: cargo clippy --all-targets --all-features -- -D warnings
41
+
42
+ - name: Build
43
+ run: cargo build --verbose
44
+
45
+ - name: Run tests
46
+ run: cargo test --all-features --verbose
47
+
48
+ - name: Check docs
49
+ env:
50
+ RUSTDOCFLAGS: -D warnings
51
+ run: cargo doc --no-deps --all-features
52
+
53
+ - name: Check package builds for crates.io
54
+ run: cargo package
55
+
56
+ - name: Run example
57
+ run: cargo run --example basic_ols
58
+
59
+ - name: Build benchmark example
60
+ run: cargo build --release --example bench_all
61
+
62
+ - name: Smoke benchmark
63
+ run: cargo run --release --example bench_smoke
64
+
65
+ msrv:
66
+ name: MSRV (1.89)
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - uses: actions/checkout@v5
70
+
71
+ # Default features only: the polars bridge pulls dependencies that
72
+ # require a newer toolchain than the crate's declared floor.
73
+ - name: Install Rust 1.89
74
+ uses: dtolnay/rust-toolchain@master
75
+ with:
76
+ toolchain: "1.89"
77
+
78
+ - name: Check against the declared rust-version
79
+ run: cargo check --all-targets
@@ -0,0 +1,45 @@
1
+ name: Publish to crates.io
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+ workflow_dispatch:
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ publish:
14
+ name: cargo publish
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v5
18
+
19
+ - name: Install stable Rust
20
+ uses: dtolnay/rust-toolchain@stable
21
+
22
+ - name: Publish crate
23
+ env:
24
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
25
+ run: |
26
+ if [ -z "$CARGO_REGISTRY_TOKEN" ]; then
27
+ echo "::warning::CARGO_REGISTRY_TOKEN is not set; skipping automated publish."
28
+ echo "Add a crates.io API token as the GitHub secret CARGO_REGISTRY_TOKEN to enable this workflow."
29
+ exit 0
30
+ fi
31
+ # Prefer env-var auth; tolerate a prior local publish of the same version
32
+ # so tagging after `cargo publish` does not fail the workflow.
33
+ set +e
34
+ out=$(cargo publish 2>&1)
35
+ status=$?
36
+ set -e
37
+ echo "$out"
38
+ if [ "$status" -eq 0 ]; then
39
+ exit 0
40
+ fi
41
+ if echo "$out" | grep -q 'already exists on crates.io'; then
42
+ echo "::notice::Version already on crates.io; treating publish as success."
43
+ exit 0
44
+ fi
45
+ exit "$status"
@@ -0,0 +1,15 @@
1
+ /target
2
+ python/target
3
+ python/.cargo-home
4
+ python/Cargo.lock
5
+ Cargo.lock
6
+ **/*.rs.bk
7
+ .DS_Store
8
+ __pycache__/
9
+ *.pyc
10
+ .venv/
11
+ bench/bench_*
12
+ !bench/README.md
13
+ # Benchmark run logs are machine-specific; keep them out of the repo.
14
+ bench/results/
15
+ .vscode/