# NOT RUN {
## without ties in phat
# }
# NOT RUN {
resp <- c(rep(1, 50), rep(0, 50))
prob <- (1:100)*0.01
RKL(y = resp, phat = prob) # expect 100
resp <- c(rep(0, 50), rep(1, 50))
RKL(y = resp, phat = prob) # expect 50
## with ties in phat
resp <- sample(c(1, 0), 100, replace = TRUE)
prob <- rep(1, 100)
RKL(y = resp, phat = prob) # expect 100
# }
Run the code above in your browser using DataLab