#############################################################
## check locally optimality: lp = up and type = "locally"
inipar <- c(2, 3)
equivalence (fimfunc = "FIM_logistic",
x = c(1.485526, 2.51446 ),
w = c(.5, .5),
lx = -5, ux = 5,
lp = inipar, up = inipar,
type = "locally")
##############################################################################
## standardized maximin D-optimal design does not depend on theta0 and theta1,
## so we fix them locally D-optimal design has a closed-form which is defined
## internally
equivalence (fimfunc = "FIM_loglin",
x = c(0, 4.2494, 17.0324, 149.9090),
w = c(0.3204, 0.1207, 0.2293, 0.3296),
lx = 0, ux = 150,
lp = c(2, 2, 1), up = c(2, 2, 15),
type = "standardized")
##############################################################################
## Not run:
# ## there is no analytical solution for locally optimal design for this model
# ## gosolnp automatically will be used to find the locally
# ## optimal design in the denominator of standardized criterion.
# ## Becasue, it is two-level nested optimization
# ## (first level on parameter space) and second level on design space)
# ## it takes so long to find 'all_optima' and construct 'answerign' set.
# equivalence (fimfunc = "FIM_power_logistic",
# x = c(-4.5515, 0.2130, 2.8075),
# w = c(0.4100, 0.3723, 0.2177),
# lx = -5, ux = 5,
# lp = c(0, 1), up = c(3, 1.5),
# type = "standardized",
# s = .2)
# ## End(Not run)
############################################################################
### when a design point is of two dimension
## Not run:
# equivalence (fimfunc = "FIM_mixed_inhibition",
# x = c(3.4614, 4.2801, 30, 30, 0, 3.1426, 0, 4.0373 ),
# w = rep(1/4, 4),
# lx = c(0, 0), ux = c(30, 60),
# lp = c(7, 4, 2, 4), up = c(7, 5, 3, 5),
# type = "standardized")
# ## here the design points are x1 = c(3.4614, 0), x2 = c(4.2801, 3.1426),
# ## x3 = c(30, 0), x4 = c(30, 4.0373)
# ## using package rgl (rgl must be installed for plot)
# equivalence (fimfunc = "FIM_mixed_inhibition",
# x = c(3.4614, 4.2801, 30, 30, 0, 3.1426, 0, 4.0373 ),
# w = rep(1/4, 4),
# lx = c(0, 0), ux = c(30, 60),
# lp = c(7, 4, 2, 4), up = c(7, 5, 3, 5),
# type = "standardized", plot_3d = "rgl")
#
# equivalence (fimfunc = "FIM_comp_inhibition",
# x = c(3.4432, 30, 30, 0, 0, 18.8954),
# w = rep(1/3, 3),
# lx = c(0, 0), ux = c(30, 60),
# lp = c(7, 4, 2), up = c(7, 5, 3),
# type = "standardized")
# ## End(Not run)
##########################################################################
##########################################################################
## defining function 'locally'
locally_det<- function(param, auxiliary){
## param is the vector of theta = (theta0, theta1, theta2)
ux <- 0
lx <- 150
xstar <- (ux + param[3]) * (lx + param[3]) * (log(ux + param[3]) -
log(lx + param[3]))/(ux - lx) - param[3]
denominator <- det(FIM_loglin(x = c(lx, xstar, ux) , w = rep(1/3, 3), param = param))
return(denominator)
}
equivalence (fimfunc = "FIM_loglin",
x = c(0, 4.2494, 17.0324, 149.9090),
w = c(0.3204, 0.1207, 0.2293, 0.3296),
lx = 0, ux = 150,
lp = c(2, 2, 1), up = c(2, 2, 15),
locally = locally_det,
type = "standardized")
Run the code above in your browser using DataLab