if (FALSE) {
# Generate a model matrix for the quadratic model
# on a semi-circle with a huge number of design points
form.q <- ~x1 + x2 + I(x1^2) + I(x2^2) + I(x1*x2)
Fx <- Fx_cube(form.q, lower = c(-1, 0), n.levels = c(1001, 501))
remove <- (1:nrow(Fx))[Fx[ ,2]^2 + Fx[ ,3]^2 > 1]
Fx <- Fx[-remove, ]
# Compute an approximate design w with an efficiency of cca 0.999
w <- od_REX(Fx, eff = 0.999)$w.best
# Remove the redundant design points based on w
Fx <- od_DEL(Fx, w)$Fx.keep
# Now an almost perfect design can be computed very rapidly:
w <- od_REX(Fx, eff = 0.9999999999)$w.best
# Plotting of the relevant directional derivative is also faster:
od_plot(Fx, w, Fx[ , 2:3], dd.size = 0.1)
}
Run the code above in your browser using DataLab