bayescomp {ICAOD} | R Documentation |
Bayesian Compound DP-Optimal Designs
Description
Finds compound Bayesian DP-optimal designs that meet the dual goal of parameter estimation and
increasing the probability of a particular outcome in a binary response model.
A compound Bayesian DP-optimal design maximizes the product of the Bayesian efficiencies of a design \xi
with respect to D- and average P-optimality, weighted by a pre-defined mixing constant
0 \leq \alpha \leq 1
.
Usage
bayescomp(
formula,
predvars,
parvars,
family = binomial(),
prior,
alpha,
prob,
lx,
ux,
iter,
k,
fimfunc = NULL,
ICA.control = list(),
sens.control = list(),
crt.bayes.control = list(),
sens.bayes.control = list(),
initial = NULL,
npar = NULL,
plot_3d = c("lattice", "rgl")
)
Arguments
formula |
A linear or nonlinear model |
predvars |
A vector of characters. Denotes the predictors in the |
parvars |
A vector of characters. Denotes the unknown parameters in the |
family |
A description of the response distribution and the link function to be used in the model.
This can be a family function, a call to a family function or a character string naming the family.
Every family function has a link argument allowing to specify the link function to be applied on the response variable.
If not specified, default links are used. For details see |
prior |
An object of class |
alpha |
A value between 0 and 1.
Compound or combined DP-criterion is the product of the efficiencies of a design with respect to D- and average P- optimality, weighted by |
prob |
Either |
lx |
Vector of lower bounds for the predictors. Should be in the same order as |
ux |
Vector of upper bounds for the predictors. Should be in the same order as |
iter |
Maximum number of iterations. |
k |
Number of design points. Must be at least equal to the number of model parameters to avoid singularity of the FIM. |
fimfunc |
A function. Returns the FIM as a |
ICA.control |
ICA control parameters. For details, see |
sens.control |
Control Parameters for Calculating the ELB. For details, see |
crt.bayes.control |
A list. Control parameters to approximate the integral in the Bayesian criterion at a given design over the parameter space.
For details, see |
sens.bayes.control |
A list. Control parameters to verify the general equivalence theorem. For details, see |
initial |
A matrix of the initial design points and weights that will be inserted into the initial solutions (countries) of the algorithm.
Every row is a design, i.e. a concatenation of |
npar |
Number of model parameters. Used when |
plot_3d |
Which package should be used to plot the sensitivity (derivative) function for two-dimensional design space. Defaults to |
Details
Let \Xi
be the space of all approximate designs with
k
design points (support points) at x_1, x_2, ..., x_k
from design space \chi
with
corresponding weights w_1,... ,w_k
.
Let M(\xi, \theta)
be the Fisher information
matrix (FIM) of a k-
point design \xi
,
\pi(\theta)
is a user-given prior distribution for the vector of unknown parameters \theta
and
p(x_i, \theta)
is the ith probability of success
given by x_i
in a binary response model.
A compound Bayesian DP-optimal design maximizes over \Xi
\int_{\theta \in \Theta} \frac{\alpha}{q}\log|M(\xi, \theta)| + (1- \alpha)
\log \left( \sum_{i=1}^k w_ip(x_i, \theta) \right) \pi(\theta) d\theta.
To verify the equivalence theorem of the output design,
use plot
function or change the value of the checkfreq
in the argument ICA.control
.
To increase the speed of the algorithm, change the value of the tuning parameters tol
and maxEval
via
the argument crt.bayes.control
when its method
component is equal to "cubature"
.
In general, if the CPU time matters, the user should find an appropriate speed-accuracy trade-off for her/his own problem.
See 'Examples' for more details.
Value
an object of class minimax
that is a list including three sub-lists:
arg
A list of design and algorithm parameters.
evol
A list of length equal to the number of iterations that stores the information about the best design (design with the minimum criterion value) of each iteration as follows:
evol[[iter]]
contains:iter
Iteration number. x
Design points. w
Design weights. min_cost
Value of the criterion for the best imperialist (design). mean_cost
Mean of the criterion values of all the imperialists. sens
An object of class 'sensminimax'
. See below.empires
A list of all the empires of the last iteration.
alg
A list with following information:
nfeval
Number of function evaluations. It does not count the function evaluations from checking the general equivalence theorem. nlocal
Number of successful local searches. nrevol
Number of successful revolutions. nimprove
Number of successful movements toward the imperialists in the assimilation step. convergence
Stopped by 'maxiter'
or'equivalence'
?method
A type of optimal designs used.
design
Design points and weights at the final iteration.
out
A data frame of design points, weights, value of the criterion for the best imperialist (min_cost), and Mean of the criterion values of all the imperialistsat each iteration (mean_cost).
The list sens
contains information about the design verification by the general equivalence theorem.
See sensbayes
for more Details.
It is only given every ICA.control$checkfreq
iterations
and also the last iteration if ICA.control$checkfreq >= 0
. Otherwise, NULL
.
References
McGree, J. M., Eccleston, J. A., and Duffull, S. B. (2008). Compound optimal design criteria for nonlinear models. Journal of Biopharmaceutical Statistics, 18(4), 646-661.
See Also
Examples
##########################################################################
# DP-optimal design for a logitic model with two predictors: with formula
##########################################################################
p <- c(1, -2, 1, -1)
myprior <- uniform(p -1.5, p + 1.5)
myformula1 <- ~exp(b0+b1*x1+b2*x2+b3*x1*x2)/(1+exp(b0+b1*x1+b2*x2+b3*x1*x2))
res1 <- bayescomp(formula = myformula1,
predvars = c("x1", "x2"),
parvars = c("b0", "b1", "b2", "b3"),
family = binomial(),
lx = c(-1, -1), ux = c(1, 1),
prior = myprior, iter = 1, k = 7,
prob = ~1-1/(1+exp(b0 + b1 * x1 + b2 * x2 + b3 * x1 * x2)),
alpha = .5, ICA.control = list(rseed = 1366),
crt.bayes.control = list(cubature = list(tol = 1e-4, maxEval = 1000)))
## Not run:
res1 <- update(res1, 1000)
plot(res1, sens.bayes.control = list(cubature = list(tol = 1e-3, maxEval = 1000)))
# or use quadrature method
plot(res1, sens.bayes.control= list(method = "quadrature"))
## End(Not run)
##########################################################################
# DP-optimal design for a logitic model with two predictors: with fimfunc
##########################################################################
# The function of the Fisher information matrix for this model is 'FIM_logistic_2pred'
# We should reparameterize it to match the standard of the argument 'fimfunc'
## Not run:
myfim <- function(x, w, param){
npoint <- length(x)/2
x1 <- x[1:npoint]
x2 <- x[(npoint+1):(npoint*2)]
FIM_logistic_2pred(x1 = x1,x2 = x2, w = w, param = param)
}
## The following function is equivalent to the function created
# by the formula: ~1-1/(1+exp(b0 + b1 * x1 + b2 * x2 + b3 * x1 * x2))
# It returns probability of success given x and param
# x = c(x1, x2) and param = c()
myprob <- function(x, param){
npoint <- length(x)/2
x1 <- x[1:npoint]
x2 <- x[(npoint+1):(npoint*2)]
b0 <- param[1]
b1 <- param[2]
b2 <- param[3]
b3 <- param[4]
out <- 1-1/(1+exp(b0 + b1 * x1 + b2 * x2 + b3 * x1 * x2))
return(out)
}
res2 <- bayescomp(fimfunc = myfim,
lx = c(-1, -1), ux = c(1, 1),
prior = myprior, iter = 1000, k = 7,
prob = myprob, alpha = .5,
ICA.control = list(rseed = 1366))
plot(res2, sens.bayes.control = list(cubature = list(maxEval = 1000, tol = 1e-4)))
# quadrature with 6 nodes (default)
plot(res2, sens.bayes.control= list(method = "quadrature"))
## End(Not run)