febolt 0.1.59__tar.gz → 0.1.60__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -362,7 +362,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
362
362
 
363
363
  [[package]]
364
364
  name = "febolt"
365
- version = "0.1.59"
365
+ version = "0.1.60"
366
366
  dependencies = [
367
367
  "blas",
368
368
  "intel-mkl-src",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "febolt"
3
- version = "0.1.59"
3
+ version = "0.1.60"
4
4
  edition = "2021"
5
5
  description = "Statistics library for Python powered by Rust"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: febolt
3
- Version: 0.1.59
3
+ Version: 0.1.60
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "febolt"
7
- version = "0.1.59"
7
+ version = "0.1.60"
8
8
  requires-python = ">=3.8"
9
9
  description = "A Rust-based Statistics and ML package, callable from Python."
10
10
  keywords = ["rust", "python", "Machine Learning", "Statistics", "pyo3"]
@@ -295,6 +295,7 @@ fn ame<'py>(
295
295
  // 10) Build final results
296
296
  let (mut dy_dx, mut se_err, mut z_vals, mut p_vals, mut sig) =
297
297
  (Vec::new(), Vec::new(), Vec::new(), Vec::new(), Vec::new());
298
+ let (mut conf_low, mut conf_high) = (Vec::new(), Vec::new());
298
299
  let mut names_out = Vec::new();
299
300
 
300
301
  for j in 0..k {
@@ -311,21 +312,28 @@ fn ame<'py>(
311
312
  z_vals.push(z);
312
313
  p_vals.push(p);
313
314
  sig.push(add_significance_stars(p));
315
+ // Compute 95% confidence interval using 1.96 * SE
316
+ conf_low.push(dy - 1.96 * s);
317
+ conf_high.push(dy + 1.96 * s);
314
318
  } else {
315
319
  z_vals.push(0.0);
316
320
  p_vals.push(1.0);
317
321
  sig.push("");
322
+ conf_low.push(dy);
323
+ conf_high.push(dy);
318
324
  }
319
325
  names_out.push(exog_names[j].clone());
320
326
  }
321
327
 
322
- // 11) Create DataFrame
328
+ // 11) Create DataFrame with extra confidence interval columns.
323
329
  let pd = py.import("pandas")?;
324
330
  let data = PyDict::new(py);
325
331
  data.set_item("dy/dx", &dy_dx)?;
326
332
  data.set_item("Std. Err", &se_err)?;
327
333
  data.set_item("z", &z_vals)?;
328
334
  data.set_item("Pr(>|z|)", &p_vals)?;
335
+ data.set_item("Conf. Int. Low", &conf_low)?;
336
+ data.set_item("Conf. Int. Hi", &conf_high)?;
329
337
  data.set_item("Significance", &sig)?;
330
338
 
331
339
  let kwargs = PyDict::new(py);
@@ -341,3 +349,4 @@ fn febolt(_py: Python, m: &PyModule) -> PyResult<()> {
341
349
  m.add_function(wrap_pyfunction!(ame, m)?)?;
342
350
  Ok(())
343
351
  }
352
+
File without changes
File without changes
File without changes