### Comparison of errors based on 4c paper: comp <- function(N, C=10, e=.1, K=10, d=.1){ sqrt( ( C/(e*N) ) * log( K/d ) ) } rct <- function(N, C=10, e=1, K=10, d=.1){ C * sqrt( ( K/(N)) * log( K/d ) ) } n <- seq(0, 10^4, by=1) y1 <- rct(n) y2 <- comp(n) pdf("Figure2c.pdf",width=5,height=5) plot(n, y1, type="l", xlab="Interactions", ylab="Estimator error", col="red", ylim=c(0,10)) lines(y2, col="green") legend("topright", inset=.05, title="Policy", c("RCT","Computational Personalization"), fill=c("red", "green"), cex=0.7, pt.cex = 1) dev.off()