#######################################################################
## some examples for exponential model
## Not run:
# # finding standardized maximin D-optimal design
# res <- mica(fimfunc = "FIM_exp_2par", lx = 0, ux = 1, lp = c(1, 1), up = c(1, 5),
# iter = 100, k = 3, type = "standardized", control = list(seed = 215))
# res <- iterate(res, 10)
# plot(res)
# # finding minimax D-optimal design
# mica(fimfunc = "FIM_exp_2par", lx = 0, ux = 1, lp = c(1, 1), up = c(1, 5),
# iter = 100, k = 3, type = "minimax", control = list(seed = 215))
# ## End(Not run)
# finding locally D-optimal design. Please note that 'lp' and 'up' are equal
mica(fimfunc = "FIM_exp_2par", lx = 0, ux = 1, lp = c(2, 3), up = c(2, 3),
iter = 40, k = 2, type = "locally", control = list(seed = 215))
# locally D-optimal design is x1 = lx, x2 = 1/lp[2]
# requesting an equally-weighted design, i.e w_1 = w_2 = ... w_k
res_loc <-mica(fimfunc = "FIM_exp_2par", lx = 0, ux = 1, lp = c(2, 3), up = c(2, 3),
iter = 40, k = 2, type = "locally",
control = list(seed = 215, equal_weight = TRUE))
## Not run:
# res_loc <- iterate(res_loc, 10) ## update the result
# plot(res_loc)
# # using symetric option for the logisitic model
# mica(fimfunc = "FIM_logistic", lx = -5, ux = 5, lp = c(0, 1), up = c(3.5 , 1.25),
# iter = 100, k = 5, control = list(rseed = 215, sym = TRUE,
# sym_point = (0 + 3.5)/2),type = "minimax")
# #######################################################################
# # 2PL model
# mica(fimfunc = "FIM_logistic", lx = -5, ux = 5, lp = c(-1, 1), up = c(1 , 2),
# iter = 100, k = 3, control = list(rseed = 215), type = "minimax")
#
# # an example on how to supply 'fimfunc' with a function
# logistic_fim <- function(x, w, param){
# a <- param[1]
# b <- param[2]
# constant <- 1/(1 + exp(-b * (x - a)))
# constant <- constant * (1 - constant)
# A <- sum(w * b^2 * constant)
# B <- sum(-w * b * (x - a) * constant)
# C <- sum(w * ((x -a)^2) * constant)
# mat <- matrix(c(A, B, B, C), 2, 2)
# return(mat)
# }
#
# mica(fimfunc = logistic_fim, lx = -5, ux = 5, lp = c(-1, 1), up = c(1 , 2),
# iter = 100, k = 3, control = list(rseed = 215), type = "minimax")
# ## is the same when 'fimfunc = "FIM_logistic'
#
# mica(fimfunc = logistic_fim, lx = -5, ux = 5, lp = c(-1, 1), up = c(-1 , 1),
# iter = 100, k = 3, control = list(rseed = 215), type = "locally")
# #######################################################################
#
# #######################################################################
# ## how to use inner_space option in control list
#
# #### Enzyme kinetic models. examples for3D plots
# mica(fimfunc = "FIM_comp_inhibition", lx = c(0, 0), ux = c(30, 60),
# lp = c(7, 4, 2), up = c(7, 5, 3), k =3, type = "standardized",
# iter = 300, control = list(rseed = 215, inner_maxit = 300,
# stop_rule = "equivalence",
# countries = 100, nimperialists = 10))
#
# ## setting the parameter space as only the points on the vertices
# mica(fimfunc = "FIM_comp_inhibition", lx = c(0, 0), ux = c(30, 60),
# lp = c(7, 4, 2), up = c(7, 5, 3), k =3, type = "standardized",
# iter = 300, control = list(rseed = 215, inner_space = "vertices",
# stop_rule = "equivalence",
# countries = 100, nimperialists = 10))
#
# ## every row is one of the vertices of Theta
# param_set <- matrix(c(7, 4, 2, 7, 5, 2, 7, 4, 3, 7, 5, 3),
# ncol = 3, nrow = 4, byrow = TRUE)
# res <-mica(fimfunc = "FIM_comp_inhibition", lx = c(0, 0), ux = c(30, 60),
# lp = c(7, 4, 2), up = c(7, 5, 3), k =3, type = "standardized",
# iter = 300, control = list(rseed = 215,inner_space = "discrete",
# stop_rule = "equivalence", countries = 100,
# nimperialists = 10, param_set = param_set))
#
#
# #######################################################################
#
# #######################################################################
# ## optimal designs for the 1Pl model
# mica(fimfunc = "FIM_logistic_1par", lx = 0, ux = 5,
# lp = 2, up = 2, k = 3, iter = 100, type = "locally")
#
# lx <- -.5
# ux <- .5
# ux - lx <= 2 * log(2 + sqrt(3))
# mica(fimfunc = "FIM_logistic_1par", lx = lx, ux = ux,
# lp = -1, up = 1, k = 1, iter = 10,
# type = "standardized")
#
#
#
# lx <- -2
# ux <- 2
# ux - lx <= 2 * log(2 + sqrt(3))
# mica(fimfunc = "FIM_logistic_1par", lx = lx, ux = ux,
# lp = -1, up = 1, k = 1, iter = 10,
# type = "standardized")
# #######################################################################
#
# ## End(Not run)
Run the code above in your browser using DataLab