Chi-Kuang Yeh, Julie Zhou, Jason Hou-Liu
June 06, 2024
This is a package to compute the optimal regression design under the second-order Least squares estimator
SLSEdesign is now available on CRAN. Hence you may install it by typing
install.packages("SLSEdesign")
or you may download the develop version by typing
devtools::install_github("chikuang/SLSEdesign") # or pak::pkg_install("chikuang/SLSEdesign")
library(SLSEdesign)
Consider a general regression model,
Let
Second order least-squares estimator is defined as
Note that
In particular, if we set the skewness parameter
A partial derivative of the mean function is required:
poly3 <- function(xi,theta){
matrix(c(1, xi, xi^2, xi^3), ncol = 1)
}
We first calculate the D-optimal design when the skewness parameter t
is set to be zero. The resulting D-optimal design should be the same as
the optimal design under the ordinary least-squares estimator.
my_design <- Dopt(N = 31, u = seq(-1, 1, length.out = 31),
tt = 0, FUN = poly3, theta = rep(1, 4), num_iter = 500)
my_design$design
# location weight
# 1 -1.0 0.2615264
# 10 -0.4 0.2373288
# 22 0.4 0.2373288
# 31 1.0 0.2615264
my_design$val
# 5.133616
Now we look at the situation when the skewness parameter t
is in the
interval (0, 1], for instance,
my_design <- Dopt(N = 31, u = seq(-1, 1, length.out = 31),
tt = 0.7, FUN = poly3, theta = rep(1, 4), num_iter = 500)
my_design$design
# location weight
# 1 -1.0 0.2714088
# 10 -0.4 0.2287621
# 22 0.4 0.2287621
# 31 1.0 0.2714088
my_design$val
# 6.27293
Add equivalence theorem plot for D-optimal design:
design = data.frame(location = c(-1, -0.447, 0.447, 1),
weight = rep(0.25, 4))
u = seq(-1, 1, length.out = 201)
plot_direction_Dopt(u, design, tt=0, FUN = poly3,
theta = rep(0, 4))
In the last example, the support points did not change as t
increases.
However, it is not always the case, and. the optimal design may be
depending on t
.
poly3_no_intercept <- function(xi, theta){
matrix(c(xi, xi^2, xi^3), ncol = 1)
}
my_design <- Dopt(N = 31, u = seq(-1, 1, length.out = 31),
tt = 0, FUN = poly3_no_intercept, theta = rep(1, 3), num_iter = 500)
my_design$design
# location weight
# 1 -1.0 0.3275005
# 7 -0.6 0.1565560
# 25 0.6 0.1565560
# 31 1.0 0.3275005
my_design$val
# 3.651524
my_design <- Dopt(N = 31, u = seq(-1, 1, length.out = 31),
tt = 0.9, FUN = poly3_no_intercept, theta = rep(1, 3), num_iter = 500)
my_design$design
# location weight
# 1 -1.0 0.2888423
# 10 -0.4 0.2096781
# 22 0.4 0.2096781
# 31 1.0 0.2888423
my_design$val
# 4.892601
- Version update for the develop version
- Improve the computational speed by vectorizing the code, and remove loops
- Remove the unnecessary dependence: tibble, gridExtra, graphics and stats
- Add c-optimality criterion
- Python and Julia version of the package, which are expected to be faster than in R
- Merge the functions that compute the directional derivatives. Maybe adding an extra argument to indicate the design criterion used.
- Gao, Lucy L. and Zhou, Julie. (2017). D-optimal designs based on the second-order least squares estimator. Statistical Papers, 58, 77–94.
- Gao, Lucy L. and Zhou, Julie. (2014). New optimal design criteria for regression models with asymmetric errors. Journal of Statistical Planning and Inference, 149, 140-151.
- Wang, Liqun and Leblanc, Alexandre. (2008). Second-order nonlinear least squares estimation. Annals of the Institute of Statistical Mathematics, 60, 883–900.
- Yeh, Chi-Kuang and Zhou, Julie. (2021). Properties of optimal regression designs under the second-order least squares estimator. Statistical Papers, 62, 75–92.
- Yin, Yue and Zhou, Julie. (2017). Optimal designs for regression models using the second-order least squares estimator. Statistica Sinica, 27, 1841-1856.