From 8aba24f99263595101a5deb85e0f86b61c531cf5 Mon Sep 17 00:00:00 2001
From: bay9355 <mia.le@studium.uni-hamburg.de>
Date: Thu, 13 Apr 2023 22:01:46 +0200
Subject: [PATCH] added ks test

---
 cami_src/utils/kolmogorov_smirnoff.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 cami_src/utils/kolmogorov_smirnoff.py

diff --git a/cami_src/utils/kolmogorov_smirnoff.py b/cami_src/utils/kolmogorov_smirnoff.py
new file mode 100644
index 0000000..2341d97
--- /dev/null
+++ b/cami_src/utils/kolmogorov_smirnoff.py
@@ -0,0 +1,18 @@
+from scipy.stats import kstest
+
+def calculate_ks_p_value(data1, data2):
+    """Calculate the Kolmogorov-Smirnoff p-value for two data sets.
+
+    Parameters
+    ----------
+    data1 : array-like
+        The first data set.
+    data2 : array-like
+        The second data set.
+
+    Returns
+    -------
+    p_value : float
+        The p-value for the Kolmogorov-Smirnoff test.
+    """
+    return kstest(data1, data2)[1]
\ No newline at end of file
-- 
GitLab