Loading...
Searching...
No Matches
Weighted dependence measures. More...
Classes | |
| class | Indep_test |
Functions | |
| double | wdm (std::vector< double > x, std::vector< double > y, std::string method, std::vector< double > weights=std::vector< double >(), bool remove_missing=true, std::vector< int > seeds=std::vector< int >()) |
| double | wdm (const Eigen::VectorXd &x, const Eigen::VectorXd &y, std::string method, Eigen::VectorXd weights=Eigen::VectorXd(), bool remove_missing=true, std::vector< int > seeds=std::vector< int >()) |
| Eigen::MatrixXd | wdm (const Eigen::MatrixXd &x, std::string method, Eigen::VectorXd weights=Eigen::VectorXd(), bool remove_missing=true, std::vector< int > seeds=std::vector< int >()) |
Detailed Description
Weighted dependence measures.
Function Documentation
◆ wdm() [1/3]
|
inline |
Calculates all pairwise dependence measures between matrix columns.
- Parameters
-
x matrix with observations in rows and variables in columns. method any method name accepted by the vector overload. weights optional case weights for the rows. remove_missing whether each pair should remove rows containing a NaN.seeds optional seeds for random Chatterjee predictor-tie breaking.
- Returns
- A matrix of pairwise dependence measures. Chatterjee matrices are generally asymmetric; all other supported measures produce symmetric matrices.
- Exceptions
-
std::runtime_error if xhas exactly one column or a pairwise call rejects its inputs.
◆ wdm() [2/3]
|
inline |
Calculates a dependence measure for two Eigen vectors.
- Parameters
-
x,y input vectors of equal length. method any method name accepted by the std::vectoroverload.weights optional case weights subject to the same validation as the std::vectoroverload.remove_missing whether to remove rows containing a NaN.seeds optional seeds for random Chatterjee predictor-tie breaking.
- Returns
- The result of the corresponding
std::vectoroverload.
- Exceptions
-
std::runtime_error under the same conditions as that overload.
◆ wdm() [3/3]
|
inline |
Calculates a weighted or unweighted dependence measure.
- Parameters
-
x,y input vectors of equal length. For Chatterjee's xi, xis the predictor andyis the response.method the dependence measure; see details for possible values. weights optional case weights. Nonempty weights must match the input length, be finite and nonnegative, and have a positive sum. Their scale does not affect the result, and zero-weight rows are ignored. remove_missing if true, rows containing aNaNare removed; otherwise aNaNraises an exception.seeds optional seeds for random Chatterjee predictor-tie breaking.
Available methods:
"pearson","prho","cor": Pearson correlation"spearman","srho","rho": Spearman's \( \rho \)"kendall","ktau","tau": Kendall's \( \tau \)"blomqvist","bbeta","beta": Blomqvist's \( \beta \)"hoeffding","hoeffd","d": Hoeffding's \( D \)"chatterjee","cxi","xi": Chatterjee's \( \xi \)
- Note
- Chatterjee's xi is asymmetric. Predictor ties are broken without consulting the response; use
seedsfor a reproducible ordering.
- Returns
- The requested estimate, or
NaNif missing-value removal leaves fewer than two observations (five for Hoeffding's D).
- Exceptions
-
std::runtime_error for size mismatches, invalid weights, unknown methods, disallowed missing or insufficient input, or an undefined Chatterjee estimate with a constant response.
1.9.8