Computes the Weighted Matthews Correlation Coefficient (WMCC) from
confusion matrix counts (Madeyski, Kitchenham and Shepperd 2026, Equation 6). Each
positive example (TP, FN) is weighted by w and each negative
example (TN, FP) by 1 before the standard MCC formula is applied, where
w is the FN:FP cost ratio (a missed relevant study is w times more
costly than screening an irrelevant one). w = 1 reduces to the standard MCC
(compute_mcc). The function is vectorised over the confusion matrix
counts.
Usage
compute_wmcc(TP, FP, FN, TN, w = 10)
Value
the Weighted Matthews Correlation Coefficient (NaN when the denominator is 0).
Arguments
TP
the number of true positives (scalar or vector).
FP
the number of false positives (scalar or vector).
FN
the number of false negatives (scalar or vector).
TN
the number of true negatives (scalar or vector).
w
the FN:FP cost ratio (default 10).
Author
Lech Madeyski
References
Lech Madeyski, Barbara Kitchenham, Martin Shepperd (2026). LLM4SCREENLIT:
Recommendations on assessing the performance of large language models for screening
literature in systematic reviews. Information and Software Technology, 198, 108204.
doi:10.1016/j.infsof.2026.108204.