about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander <alexanderkabua@gmail.com>2022-04-25 13:36:08 +0300
committerAlexander <alexanderkabua@gmail.com>2022-04-25 13:36:08 +0300
commitc4126434743a6f01cee4e2468ad889d3cdaa75a2 (patch)
tree1ea958226a8847e6d5aa720e3db57c823f28fbb0 /src
parent80f50c5a1cdc66e900cbfabe07ba60e8d83f5f57 (diff)
downloadcorrelation_rust-c4126434743a6f01cee4e2468ad889d3cdaa75a2.tar.gz
compute p val for spearman
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f78fc0f..378bd33 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -76,7 +76,16 @@ impl Spearman {
 impl Correlation for Spearman {
 
     fn correlate(&self,x:&[f64],y:&[f64]) -> (f64,f64){
-        (1.2,2.1)
+
+        //dditional workspace of size 2*n is required in work
+        let mut vec = Vec::with_capacity(2 * self.n);
+        let workspace: &mut [f64] = vec.as_mut_slice();
+        let rho = spearman(x, 1, y, 1, self.n, workspace);
+
+        //p-val two sided
+
+        let p_val = 
+        return (rho,2.1);
     }
 }