Sensitivity Analysis 3 - Effect of varying number of picked slots
Source:vignettes/sensitivity3.Rmd
sensitivity3.RmdVarying number of picked options
For each colleague, the number of picked options is a number randomly
drawn from a normal distribution with mean p and sd
p_sd. (Note that for technical reasons, the first
colleagues always picks exactly p slots currently.)
In other words, the number of p varies.
Example with non-varying p
out <- count_common_slots(n_colleagues = 3,
o = 7,
p = 3,
dep = .5,
p_sd = 0)
out
#> slots_chosen Freq is_match
#> 1 1 3 TRUEAs can be seen, the number of picked options remains constant across all colleagues:
attr(out, "chosen_options_l")
#> [[1]]
#> [1] 3 5 1
#>
#> [[2]]
#> [1] 5 7 1
#>
#> [[3]]
#> [1] 3 6 1Example with varying p
out2 <- count_common_slots(n_colleagues = 3,
o = 7,
p = 3,
dep = .5,
p_sd = 1)
out2
#> slots_chosen Freq is_match
#> 1 2 3 TRUE
#> 2 4 3 TRUEAs can be seen, the number of picked options remains constant across all colleagues:
attr(out2, "chosen_options_l")
#> [[1]]
#> [1] 4 3 2
#>
#> [[2]]
#> [1] 5 4 2
#>
#> [[3]]
#> [1] 3 7 4 2Of course, the number of picked options influences the probability of finding a match.
Sensitivity analysis 3
tic()
grid3 <- populate_grid(n_colleagues = 3:5,
o = c(5, 10, 15, 20),
p = c(3, 5),
dep = c(0, .5),
p_sd = c(0, 1))
toc()
tic()
grid3a <- populate_grid(n_colleagues = 3:4,
o = c(5, 10),
p = c(3, 5),
dep = c(0),
p_sd = c(0, 1))
toc()
tic()
grid3b <- populate_grid(n_colleagues = 3:5,
o = c(5, 10, 15),
p = c(3, 5),
dep = c(0.5),
p_sd = c(0, 1))
toc()It’s quicker to load from disk:
#data(grid3)
