Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
kampersanda committed Nov 2, 2024
1 parent bf3f2d7 commit d0b034e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/statistical_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ use crate::errors::Result;
///
/// where $`k^A_i = k^B_i`$ for all $`i`$.
///
/// # Examples
///
/// ```
/// use elinor::statistical_tests::pairs_from_maps;
///
/// let map_a = [("a", 0.70), ("b", 0.30), ("c", 0.20)].into();
/// let map_b = [("a", 0.50), ("b", 0.10), ("c", 0.00)].into();
/// let pairs = pairs_from_maps(&map_a, &map_b).unwrap();
/// assert_eq!(pairs, vec![(0.70, 0.50), (0.30, 0.10), (0.20, 0.00)]);
/// ```
///
/// # Errors
///
/// * [`ElinorError::InvalidArgument`] if maps have different sets of keys.
Expand All @@ -57,6 +68,18 @@ where
///
/// where $`k^1_i = k^2_i = \dots = k^m_i`$ for all $`i`$.
///
/// # Examples
///
/// ```
/// use elinor::statistical_tests::tuples_from_maps;
///
/// let map_a = [("a", 0.70), ("b", 0.30), ("c", 0.20)].into();
/// let map_b = [("a", 0.50), ("b", 0.10), ("c", 0.00)].into();
/// let map_c = [("a", 0.60), ("b", 0.20), ("c", 0.10)].into();
/// let tuples = tuples_from_maps([&map_a, &map_b, &map_c]).unwrap();
/// assert_eq!(tuples, vec![vec![0.70, 0.50, 0.60], vec![0.30, 0.10, 0.20], vec![0.20, 0.00, 0.10]]);
/// ```
///
/// # Errors
///
/// * [`ElinorError::InvalidArgument`] if maps have different sets of keys.
Expand Down
4 changes: 2 additions & 2 deletions src/statistical_tests/bootstrap_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Bootstrap test.
//! Two-sided paired Bootstrap test.
use rand::rngs::StdRng;
use rand::Rng;
use rand::SeedableRng;
Expand All @@ -7,7 +7,7 @@ use crate::errors::ElinorError;
use crate::errors::Result;
use crate::statistical_tests::student_t_test::compute_t_stat;

/// Two-sided Bootstrap test.
/// Two-sided paired Bootstrap test.
///
/// # Examples
///
Expand Down

0 comments on commit d0b034e

Please sign in to comment.