if (FALSE) {
# Compute an A-optimal block size two design
# for 6 treatments and 9 blocks
Fx <- Fx_blocks(6)
w <- od_MISOCP(Fx, b3 = 9, crit = "A", bin = TRUE)$w.best
des <- combn(6, 2)[, as.logical(w)]
print(des)
library(igraph)
grp <- graph_(t(des), from_edgelist(directed = FALSE))
plot(grp, layout=layout_with_graphopt)
# Compute a symmetrized D-optimal approximate design
# for the full quadratic model on a square grid
# with uniform marginal constraints
Fx <- Fx_cube(~x1 + x2 + I(x1^2) + I(x2^2) + I(x1*x2), n.levels = c(21, 21))
A3 <- matrix(0, nrow = 21, ncol = 21^2)
for(i in 1:21) A3[i, (i*21 - 20):(i*21)] <- 1
w <- od_MISOCP(Fx, b3 = rep(1, 21), A3 = A3, crit = "D", type = "approximate")$w.best
w.sym <- od_SYM(Fx, w, b3 = rep(1, 21), A3 = A3)$w.sym
od_plot(Fx, w.sym, Fx[, 2:3], dd.size = 2)
}
Run the code above in your browser using DataLab