17
0
coldcallbot/assessment_and_tracking/simulation.R
Benjamin Mako Hill 78ac188f04 code to create final case discussion grades
This still needs to be check over but this is new code to build the
final grades. Current threshold for minimum questions comes from 1000
simulated classes (simulation.R).
2024-09-28 16:13:14 -07:00

25 lines
731 B
R

weight.fac <- 2
num.calls <- 373
num.students <- 76
gen.calls.per.students <- function (x) {
raw.weights <<- rep(1, num.students)
names(raw.weights) <- seq(1, num.students)
table(sapply(1:num.calls, function (i) {
probs <- raw.weights / sum(raw.weights)
selected <- sample(names(raw.weights), 1, prob=probs)
## update the raw.weights
raw.weights[selected] <<- raw.weights[selected] / weight.fac
#print(raw.weights)
return(selected)
}))
}
simulated.call.list <- unlist(lapply(1:1000, gen.calls.per.students))
hist(simulated.call.list)
quantile(simulated.call.list, probs=seq(0,1,by=0.01))
quantile(simulated.call.list, probs=0.05)