# NOT RUN {
inputDistribution <- list()
inputDistribution[[1]] <- list("norm",c(4,1))
inputDistribution[[2]] <- list("norm",c(0,1))
inputDistribution[[3]] <- list("norm",c(-1,3))
inputDimension <- length(inputDistribution)
p <- 1e-5
threshold <- qnorm(p, 3, sqrt(11))
f <- function(Input){
sum(Input) - threshold
}
dir.monot <- c(1, 1, 1)
N.calls <- 300
res.MRM <- MRM(f, inputDimension, inputDistribution,
dir.monot, N.calls, Method = "MRM", silent = FALSE)
N <- 1:dim(res.MRM[[1]])[1]
plot(N, res.MRM[[1]][, 1],
col = "black", lwd=2, type='l', ylim=c(0, 50*p),
xlab="Number of runs to the failure function",
ylab="")
lines(N, res.MRM[[1]][, 2], col = "black", lwd = 2)
lines(N, res.MRM[[1]][, 3], col = "red", lwd = 2)
lines(N, res.MRM[[1]][, 7], col = "blue", lwd = 2, lty = 2)
lines(N, rep(p, length(N)), lwd= 2, col= "orange", lty=3 )
legend("topright",
c("Exact Bounds", "MLE","p.hat", "p"),
col = c("black", "red", "blue", "orange"),
text.col = c("black", "red", "blue", "orange"),
lty = c(1, 1, 2, 3),
merge = TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab