################################################################ ##########################MetalCutting########################## ################################################################ ################################################################ library("OBsMD") data("MetalCutting", package = "OBsMD") str(MetalCutting) head(MetalCutting) ################################################################ ################################################################ #########MetalCutting Tab3 - 2FIs; prior beta(1, 7)############# #######################add 4 runs############################### ################################################################ X <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 2:7] y <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 8] es3.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 7, blk = 0, mFac = 6, mInt = 2, nTop = 64) print(es3.OBsProb, nTop = 64) summary(es3.OBsProb) pdf("Imm6es.pdf", paper = "a4r") plot(es3.OBsProb, main = "mxint=2") dev.off() ######################################## nMod <- 57 Xcand <- MetalCutting[, 2:7] # or Xcand <- matrix(c(-1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1), nrow = 64, ncol = 6, dimnames = list(1:64, c("A", "B", "C", "D", "E", "F")), byrow = TRUE) Mbest <- as.matrix(combinations(64, 4, 1:64, repeats = TRUE)) es3.pp_omd <- OMD(OBsProb = es3.OBsProb, nFac = 6, nBlk = 0, nMod = 57, nFoll = 4, Xcand = Xcand, mIter = 0, nStart = nrow(Mbest), startDes = Mbest, top = 10) print(es3.pp_omd) summary(es3.pp_omd) ################################################################ ################################################################ #################Tab Tab3 - 2FIs; prior beta(1, 7)############### ####################add 4 runs: 12-36-52-59##################### ################################################################ X <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 1:7] y <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 8] TOP_DES <- cbind(blk = rep(1, 4), MetalCutting[es3.pp_omd$TOPDES[1, ], c(-1, -8)]) y_TOP_DES <- MetalCutting[es3.pp_omd$TOPDES[1, ], 8] X <- rbind(X, TOP_DES) y <- c(y, y_TOP_DES) es3.aug.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 7, blk = 1, mFac = 6, mInt = 2, nTop = 64) print(es3.aug.OBsProb, nTop = 10) pdf("Imm7esagg.pdf", paper = "a4r") plot(es3.aug.OBsProb, main = "mxint = 2") dev.off() ################################################################ ################################################################ #########MetalCutting Tab3 - 3FIs; prior beta(1, 7)############# #######################add 4 runs############################### ################################################################ X <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 2:7] y <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 8] es3_3FI.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 7, blk = 0, mFac = 6, mInt = 3, nTop = 64) print(es3_3FI.OBsProb, nTop = 64) summary(es3_3FI.OBsProb) pdf("Imm13es.pdf", paper = "a4r") plot(es3_3FI.OBsProb, main = "mxint = 3") dev.off() ######################################## nMod <- 57 Xcand <- MetalCutting[, 2:7] Mbest <- as.matrix(combinations(64, 4, 1:64, repeats = TRUE)) es3_3FI.pp_omd <- OMD(OBsProb = es3_3FI.OBsProb, nFac = 6, nBlk = 0, nMod = 57, nFoll = 4, Xcand = Xcand, mIter = 0, nStart = nStarts, startDes = Mbest, top = 30) print(es3_3FI.pp_omd) summary(es3_3FI.pp_omd) ################################################################ ################################################################ #################Tab Tab3 - 3FIs; prior beta(1, 7)############## ####################add 4 runs: 4-11-52-59###################### ################################################################ X <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 1:7] y <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 8] TOP_DES <- cbind(blk = rep(1, 4), MetalCutting[es3_3FI.pp_omd$TOPDES[1, ], c(-1, -8)]) y_TOP_DES <- MetalCutting[es3_3FI.pp_omd$TOPDES[1, ], 8] X <- rbind(X, TOP_DES) y <- c(y, y_TOP_DES) es3_3FI.aug.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 7, blk = 1, mFac = 6, mInt = 3, nTop = 64) print(es3_3FI.aug.OBsProb) pdf("Imm14esagg.pdf", paper = "a4r") plot(es3_3FI.aug.OBsProb, main = "mxint = 3") dev.off() ################################################################ ################################################################ #############MetalCutting 2FIs; prior beta(1, 1)################ ################################################################ ################################################################ X <- MetalCutting[, 2:7] y <- MetalCutting[, 8] es2.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 1, blk = 0, mFac = 6, mInt = 2, nTop = 64) summary(es2.OBsProb, nTop = 3) print(es2.OBsProb, nTop = 3) pdf("Imm1es.pdf", paper = "a4r") plot(es2.OBsProb, main = "mxint = 2") dev.off() ################################################################ ################################################################ #############Tab7 - 2FIs; prior beta(1, 1)###################### ################################################################ ################################################################ X <- MetalCutting[c(2, 25, 37, 62, 15, 24, 44, 51), 2:7] y <- MetalCutting[c(2, 25, 37, 62, 15, 24, 44, 51), 8] es7.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 1, blk = 0, mFac = 6, mInt = 2, nTop = 64) summary(es7.OBsProb) print(es7.OBsProb, nTop = 10) pdf("Imm2es.pdf", paper = "a4r") plot(es7.OBsProb, main = "mxint = 2") dev.off() ######################################## nMod <- 42 Xcand <- MetalCutting[, 2:7] #or Xcand <- matrix(c(-1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, 1, -1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, -1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, 1, 1, 1, 1, 1, 1, -1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1), nrow = 64, ncol = 6, dimnames = list(1:64, c("A", "B", "C", "D", "E", "F")), byrow = TRUE) Mbest <- as.matrix(combinations(64, 4, 1:64, repeats = TRUE)) es7.pp_omd <- OMD(OBsProb = es7.OBsProb, nFac = 6, nBlk = 0, nMod = 42, nFoll = 4, Xcand = Xcand, mIter = 0, nStart = nrow(Mbest), startDes = Mbest, top = 8) print(es7.pp_omd) summary(es7.pp_omd) ################################################################ ################################################################ ######################add 28-40-44-44########################### ################################################################ ################################################################ X <- MetalCutting[c(2, 25, 37, 62, 15, 24, 44, 51), 1:7] y <- MetalCutting[c(2, 25, 37, 62, 15, 24, 44, 51), 8] TOP_DES <- cbind(blk = rep(1, 4), MetalCutting[es7.pp_omd$TOPDES[1, ], c(-1, -8)]) y_TOP_DES <- MetalCutting[es7.pp_omd$TOPDES[1, ], 8] X <- rbind(X, TOP_DES) y <- c(y, y_TOP_DES) es7.aug.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 1, blk = 1, mFac = 6, mInt = 2, nTop = 64) print(es7.aug.OBsProb, nTop = 10) pdf("Imm3esagg.pdf", paper = "a4r") plot(es7.aug.OBsProb, main = "mxint = 2") dev.off() ################################################################ ################################################################ ###EXCHANGE ALGORITHM########################################### ################################################################ ################################################################ X <- MetalCutting[c(2, 25, 37, 62, 15, 24, 44, 51), 2:7] y <- MetalCutting[c(2, 25, 37, 62, 15, 24, 44, 51), 8] es7.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 1, blk = 0, mFac = 6, mInt = 2, nTop = 64) summary(es7.OBsProb) nMod <- 42 Mbest <- as.matrix(combinations(64, 4, 1:64, repeats = TRUE)) Xcand <- MetalCutting[, 2:7] es7.pp_omd_ex <- OMD(OBsProb = es7.OBsProb, nFac = 6, nBlk = 0, nMod = 42, nFoll = 4, Xcand = Xcand, mIter = 20, nStart = 25, startDes = NULL, top = 8) print(es7.pp_omd_ex) summary(es7.pp_omd_ex) #28 40 44 44 ################################################################ ################################################################ ##############Tab8 - 2FIs; prior beta(1, 1)##################### ################################################################ ################################################################ X <- MetalCutting[c(62, 15, 6, 17, 41, 28, 36, 55), 2:7] y <- MetalCutting[c(62, 15, 6, 17, 41, 28, 36, 55), 8] es8.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 1, blk = 0, mFac = 6, mInt = 2, nTop = 64) print(es8.OBsProb, nTop = 10) pdf("Imm4es.pdf", paper = "a4r") plot(es8.OBsProb, main = "mxint = 2") dev.off() ######################################## nMod <- 8 Xcand <- MetalCutting[, 2:7] Mbest <- as.matrix(combinations(64, 4, 1:64, repeats = TRUE)) es8.pp_omd <- OMD(OBsProb = es8.OBsProb, nFac = 6, nBlk = 0, nMod = 8, nFoll = 4, Xcand = Xcand, mIter = 0, nStart = nrow(Mbest), startDes = Mbest, top = 8) print(es8.pp_omd) summary(es8.pp_omd) ################################################################ ################################################################ ######################add 10-51-59-64########################### ################################################################ ################################################################ X <- MetalCutting[c(62, 15, 6, 17, 41, 28, 36, 55), 1:7] y <- MetalCutting[c(62, 15, 6, 17, 41, 28, 36, 55), 8] TOP_DES <- cbind(blk = rep(1, 4), MetalCutting[es8.pp_omd$TOPDES[1, ], c(-1, -8)]) y_TOP_DES <- MetalCutting[es8.pp_omd$TOPDES[1, ], 8] X <- rbind(X, TOP_DES) y <- c(y, y_TOP_DES) es8.aug.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 1, blk = 1, mFac = 6, mInt = 2, nTop = 64) print(es8.aug.OBsProb) pdf("Imm5esagg.pdf", paper = "a4r") plot(es8.aug.OBsProb, main = "mxint = 2") dev.off() ################################################################ ################################################################ #################Tab3 - 2FIs; prior beta(1, 7)################## #################add runs one-run-at-a-time##################### ################################################################ X <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 2:7] y <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 8] es3.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 7, blk = 0, mFac = 6, mInt = 2, nTop = 64) summary(es3.OBsProb) pdf("Imm8es.pdf", paper = "a4r") plot(es3.OBsProb, main = "mxint = 2") dev.off() ######################################## nMod <- 57 Xcand <- MetalCutting[, 2:7] Mbest <- as.matrix(combinations(64, 1, 1:64, repeats = TRUE)) es3_1.pp_omd <- OMD(OBsProb = es3.OBsProb, nFac = 6, nBlk = 0, nMod = 57, nFoll = 1, Xcand = Xcand, mIter = 0, nStart = nrow(Mbest), startDes = Mbest, top = 10) print(es3_1.pp_omd) summary(es3_1.pp_omd) ################################################################ ################################################################ ###############Tab3 - 2FIs; prior beta(1, 7)#################### #######################add 1 run: 36############################ ################################################################ X <-MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 1:7] y <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3), 8] TOP_DES <- c(blk = c(1), MetalCutting[es3_1.pp_omd$TOPDES[1, ], c(-1, -8)]) y_TOP_DES <- MetalCutting[es3_1.pp_omd$TOPDES[1, ], 8] X <- rbind(X, TOP_DES) y <- c(y, y_TOP_DES) es3_1_1.aug.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 7, blk = 1, mFac = 6, mInt = 2, nTop = 64) print(es3_1_1.aug.OBsProb, nTop = 64) pdf("Imm9esagg.pdf", paper = "a4r") plot(es3_1_1.aug.OBsProb, main = "mxint = 2") dev.off() ######################################## nMod <- 10 Xcand <- MetalCutting[, 2:7] Mbest <- as.matrix(combinations(64, 1, 1:64, repeats = TRUE)) es3_2_1.aug.pp_omd <- OMD(OBsProb = es3_1_1.aug.OBsProb, nFac = 6, nBlk = 1, nMod = 10, nFoll = 1, Xcand = Xcand, mIter = 0, nStart = nrow(Mbest), startDes = Mbest, top = 10) print(es3_2_1.aug.pp_omd, top = 64) summary(es3_2_1.aug.pp_omd) ################################################################ ################################################################ ################Tab3 - 2FIs; prior beta(1, 7)################### ########################add 1 run: 55 ########################## ################################################################ X <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3, 36), 1:7] y <- MetalCutting[c(62, 28, 51, 16, 64, 21, 26, 42, 44, 23, 39, 1, 14, 49, 37, 3, 36), 8] TOP_DES <- c(blk = c(1), MetalCutting[es3_2_1.aug.pp_omd$TOPDES[1, ], c(-1, -8)]) y_TOP_DES <- MetalCutting[es3_2_1.aug.pp_omd$TOPDES[1, ], 8] X <- rbind(X, TOP_DES) y <- c(y, y_TOP_DES) es3_2_2.aug.OBsProb <- OBsProb(X = X, y = y, abeta = 1, bbeta = 7, blk = 1, mFac = 6, mInt = 2, nTop = 64) print(es3_2_2.aug.OBsProb, nTop = 64) pdf("Imm10esagg.pdf", paper = "a4r") plot(es3_2_2.aug.OBsProb, main = "mxint = 2") dev.off()