diff options
| author | Alexander <alexanderkabua@gmail.com> | 2022-04-25 11:12:38 +0300 |
|---|---|---|
| committer | Alexander <alexanderkabua@gmail.com> | 2022-04-25 11:12:38 +0300 |
| commit | 91ceb2725a1214c7d4e4eefbea682edf42e73878 (patch) | |
| tree | 6cbbfe0fb7790af3ae961f26c8dd854fc0bd6e3f /src | |
| parent | 6c0fb2ceb3ea757fb5e016b99497c384326b9904 (diff) | |
| parent | cd51dc6af23c41e63b06cae847282a9873851298 (diff) | |
| download | correlation_rust-91ceb2725a1214c7d4e4eefbea682edf42e73878.tar.gz | |
Merge branch 'master' of https://github.com/Alexanderlacuna/correlation_rust into main
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 35 | ||||
| -rw-r--r-- | src/main.rs~ | 3 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..1832f9b --- /dev/null +++ b/src/main.rs @@ -0,0 +1,35 @@ +use rgsl::{ + randist::t_distribution::{tdist_P, tdist_Q}, + statistics::{correlation, spearman}, +}; + + +trait Correlation { + fn correlate(&self,x:&[f64],y:&[f64]) ->(f64,f64); +} + +struct Pearson { + n: usize, + degree_of_freedom:f64, +} + +impl Pearson { + fn new(n:usize) -> Self { + + Self { + n, + degree_of_freedom:(n - 2) as f64, + } + } +} + + +impl Correlation for Pearson { + fn correlate(&self,x:&[f64],y:&[f64]) ->(f64,f64){ + (1.2,0.1) + } +} + +fn main() { + +} diff --git a/src/main.rs~ b/src/main.rs~ new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs~ @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} |
