choice.law <- list()
choice.law[[1]] <- list("norm",c(4,1))
choice.law[[2]] <- list("norm",c(0,1))
ndim <- 2
dir.monot <- c(1, -1)
N.calls <- 80
f <- function(Input){
return(Input[1] - Input[2])
}
res.MRM <- MRM(f, ndim, choice.law, dir.monot, N.calls, Method = "MRM",
ordre.p = 0, silent = FALSE)
N <- 1:dim(res.MRM)[1]
plot(N, res.MRM[, 1],
col = "blue", lwd=2, type='l', ylim=c(0,1e-2),
xlab="Number of call to the failure function",
ylab="")
lines(N, res.MRM[, 2], col = "blue", lwd = 2)
lines(N, res.MRM[, 3], col = "red", lwd = 2)
lines(N, res.MRM[, 4], col = "orange", lwd = 2, lty = 2)
lines(N, res.MRM[, 5], col = "orange", lwd = 2, lty = 2)
legend("topright",
c("Exact Bounds", "MLE", "Confidence interval"),
col = c("blue", "red", "orange"),
text.col = c("blue", "red", "orange"),
lty = c(1, 1, 2),
merge = TRUE)
#It can be long:
res.MC_monotone <- MRM(f, ndim, choice.law, dir.monot, N.calls, Method = "MC_monotone",
ordre.p = 0, silent = FALSE)Run the code above in your browser using DataLab