View source: R/corrected_mutual_information.R
reduced_mutual_information | R Documentation |
Computes the Newman's Reduced Mutual Information (RMI) as defined in \insertCitecorrected_MI_Newman2020clustAnalytics.
reduced_mutual_information(
c1,
c2,
base = 2,
normalized = FALSE,
method = "approximation2",
warning = TRUE
)
c1 , c2 |
membership vectors |
base |
base of the logarithms used in the calculations. Changing it only scales the final value. By default set to e=exp(1). |
normalized |
If true, computes the normalized version of the corrected mutual information. |
method |
Can be "hybrid" (default, combines Monte Carlo with analytical formula), "monte_carlo", approximation1" (appropriate for partitions into many very small clusters), or "approximation2" (for partitions into few larger clusters). |
warning |
set to false to ignore the warning. |
The implementation is based on equations 23 (25 for the normalized case) and 29 in \insertCitecorrected_MI_Newman2020clustAnalytics.
The evaluations of the \Gamma
functions can get too large and cause overflow
issues in the intermediate steps, so the following term of equation 29:
\frac{1}{2} \log \frac{\Gamma(\mu R) \Gamma(\nu S)} {(\Gamma(\nu)\Gamma(R))^S (\Gamma(\mu)\Gamma(S))^R }
is rewritten as
\frac{1}{2} (\log\Gamma(\mu R) + \log\Gamma(\nu S) - S\log(\Gamma(\nu) - S\log(\Gamma(R) - R\log\Gamma(\mu) - R\log\Gamma(R) )
, and then the function lgamma is used instead of gamma.
The value of Newman's RMI (a scalar).
corrected_MI_Newman2020clustAnalytics
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.