Computes the relation of score before a change (e.g. permutation, LOCO, ...) and after.
Details
If minimize == TRUE
, then scores_post - scores_pre
is computed for relation == "difference"
,
otherwise scores_pre - scores_post
is given.
Examples
pre = rnorm(10)
post = pre + runif(10)
compute_score_relation(pre, post)
#> [1] 0.72830566 0.41247286 0.15922928 0.84570355 0.88436910 0.39599811
#> [7] 0.03814079 0.95139597 0.78372752 0.21943974
compute_score_relation(pre, post, "ratio")
#> [1] 2.13429016 0.01163002 0.86916936 1.39660369 0.18826730 4.39943753
#> [7] 1.03024210 1.91425802 0.19157035 1.56162023
compute_score_relation(pre, post, minimize = FALSE)
#> [1] -0.72830566 -0.41247286 -0.15922928 -0.84570355 -0.88436910 -0.39599811
#> [7] -0.03814079 -0.95139597 -0.78372752 -0.21943974