Using GeneralUtilities`PrintDefintions on KendallTau to investigate which method it is using I discovered that it is using the $b$ method. It uses a $KendallVariant variable to check for which method to run but this appears to be currently hardcoded to "B". However, there is code in KendallTau that checks this variable for the "A" and "C" methods to calculate the respective values.
Is there some hidden method-type option for KendallTau that can be used to set the $KendallVariant variable to "C"? I am not that apt at hunting around built-in functions. I have had a look with PrintDefintions but nothing immediately jumps out as being a likely way to change this hidden variable.
Answer
ClearAll[kT]
kT[v_String: "B"][x__] := Block[{Statistics`DependencyMeasuresDump`$KendallVariant = v},
KendallTau[x]]
sa = SparseArray[{{2, 2} -> 1, {5, 3} -> 2, {6, 1} -> 3}];
Row[Labeled[MatrixForm@kT[#][sa], #, Top] & /@ {"A", "B", "C"}]

Comments
Post a Comment