methods.hpp
1 // Copyright © 2020 Thomas Nagler
2 //
3 // This file is part of the wdm library and licensed under the terms of
4 // the MIT license. For a copy, see the LICENSE file in the root directory
5 // or https://github.com/tnagler/wdm/blob/master/LICENSE.
6 
7 #pragma once
8 
9 namespace wdm {
10 
11 namespace methods {
12 
13 inline bool is_hoeffding(std::string method)
14 {
15  return (method == "hoeffding") | (method == "hoeffd") | (method == "d");
16 }
17 inline bool is_kendall(std::string method)
18 {
19  return (method == "kendall") | (method == "ktau") | (method == "tau");
20 }
21 inline bool is_pearson(std::string method)
22 {
23  return (method == "pearson") | (method == "prho") | (method == "cor");
24 }
25 inline bool is_spearman(std::string method)
26 {
27  return (method == "spearman") | (method == "srho") | (method == "rho");
28 }
29 inline bool is_blomqvist(std::string method)
30 {
31  return (method == "blomqvist") | (method == "bbeta") | (method == "beta");
32 }
33 
34 inline size_t get_min_nobs(std::string method)
35 {
36  if (is_hoeffding(method)) {
37  return 5;
38  } else {
39  return 2;
40  }
41 }
42 
43 }
44 
45 }
Weighted dependence measures.
Definition: bbeta.hpp:11