# A lower bound on the D-efficiencies of the uniform designs
# for the quadratic regression on a line grid
Fx <- Fx_cube(~x1 + I(x1^2), n.levels = 101)
effbound(Fx, rep(1/101, 101))
# The precise value of the D-efficiency
# requires computing the D-optimal design:
w.opt <- od_REX(Fx)$w.best
optcrit(Fx, rep(1/101, 101)) / optcrit(Fx, w.opt)
if (FALSE) {
# Let us do this for polynomial regressions of various degrees:
n <- 101; d.max <- 10; x <- seq(-1, 1, length = n)
effs <- matrix(0, ncol = 2, nrow = d.max)
Fx <- matrix(1, ncol = 1, nrow = n)
for(d in 1:d.max) {
Fx <- cbind(Fx, x^d)
effs[d, 1] <- effbound(Fx, rep(1/n, n))
w.opt <- od_REX(Fx)$w.best
effs[d, 2] <- optcrit(Fx, rep(1/n, n)) / optcrit(Fx, w.opt)
}
print(effs)
# We see that the lower bound becomes more and more conservative
# compared to the real efficiency which actually increases with d.
# Compute a D-optimal design for the main effects model
# on a random subsample of a 6D cube
n <- 1000000; m <- 6
Fx <- cbind(1, matrix(runif(n*m), ncol = m))
w <- od_REX(Fx, eff = 0.99)$w.best
Fx <- od_DEL(Fx, w)$Fx.keep
w <- od_REX(Fx)$w.best
# Now we will compute a lower bound on efficiency of such design
# on the entire (continuous) cube:
Fx <- rbind(Fx, Fx_cube(~x1 + x2 + x3 + x4 + x5 + x6, lower = rep(0, 6)))
w <- c(w, rep(0, 2^6))
effbound(Fx, w)
# The real D-efficiency of w on the entire cube is
optcrit(Fx, w)/od_REX(Fx)$Phi.best
}
Run the code above in your browser using DataLab