You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just realized while running both parametric and non-parametric versions of the SK test that the non-parametric version is much slower. I have not measured or profiled the executions, although looking at the code, I suspect the diff function in PartitionNonParametric is the culprit. Once a magnitude is non-negligible, the variable negligible is not updated anymore but the nested loop continues to execute. Unfortunately, I am unable to send a PR myself at the moment, but I can provide a potential fix below.
Current version:
diff <- function(k, g, av, means){
negligible <- TRUE
for(i in k:(g-1)){
for(j in (i+1):g){
a <- av$model[av$model[,2] == names(means[k]),1]
b <- av$model[av$model[,2] == names(means[g]),1]
magnitude <- as.character(effsize::cliff.delta(a,b)$magnitude, paired=TRUE)
if(magnitude != "negligible"){
negligible <- FALSE
}
}
}
return(negligible)
}
Fixed version:
diff <- function(k, g, av, means){
for(i in k:(g-1)){
for(j in (i+1):g){
a <- av$model[av$model[,2] == names(means[k]),1]
b <- av$model[av$model[,2] == names(means[g]),1]
magnitude <- as.character(effsize::cliff.delta(a,b)$magnitude, paired=TRUE)
if(magnitude != "negligible"){
return(FALSE)
}
}
}
return(TRUE)
}
Cheers
Christoph
The text was updated successfully, but these errors were encountered:
Hi,
I just realized while running both parametric and non-parametric versions of the SK test that the non-parametric version is much slower. I have not measured or profiled the executions, although looking at the code, I suspect the
diff
function inPartitionNonParametric
is the culprit. Once a magnitude is non-negligible, the variablenegligible
is not updated anymore but the nested loop continues to execute. Unfortunately, I am unable to send a PR myself at the moment, but I can provide a potential fix below.Current version:
Fixed version:
Cheers
Christoph
The text was updated successfully, but these errors were encountered: