if (FALSE) {
# The Fx for the cubic model on a discretized interval
Fx <- Fx_cube(~x1 + I(x1^2) + I(x1^3), lower=0, upper=2, n.levels=101)
# The D-optimal design of size 20
w <- od_KL(Fx, 20, t.max=5)$w.best
od_plot(Fx, w, Fx[, 2])
# The Fx for the full quadratic response surface model on a non-convex region
Fx <- Fx_cube(~x1 + x2 + I(x1^2) + I(x2^2) + I(x1*x2), n.levels=c(51, 51))
keep <- rep(TRUE, nrow(Fx))
for(i in 1:nrow(Fx)) if(prod(abs(Fx[i, 2:3])) > 0.2) keep[i] <- FALSE
Fx <- Fx[keep, ]
# The D-optimal design of size 29 without replications
w <- od_KL(Fx, 29, bin=TRUE, t.max=5)$w.best
od_plot(Fx, w, Fx[, 2:3])
# The Fx for the chemical weighing with 3 items and a bias term
Fx <- Fx_cube(~x1 + x2 + x3, n.levels=c(3, 3, 3))
# The D-optimal design of size 12
w <- od_KL(Fx, 12, t.max=2)$w.best
od_plot(Fx, w, Fx[, 2:4])
}
Run the code above in your browser using DataLab