leff {ICAOD} | R Documentation |
Calculates Relative Efficiency for Locally Optimal Designs
Description
Given a vector of initial estimates for the parameters, this function calculates the D-and PA- efficiency of a design \xi_1
with respect to a design \xi_2
.
Usually, \xi_2
is an optimal design.
Usage
leff(
formula,
predvars,
parvars,
family = gaussian(),
inipars,
type = c("D", "PA"),
fimfunc = NULL,
x2,
w2,
x1,
w1,
npar = length(inipars),
prob = NULL
)
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 |
inipars |
Vector. Initial values for the unknown parameters. It will be passed to the information matrix and also probability function. |
type |
A character. |
fimfunc |
A function. Returns the FIM as a |
x2 |
Vector of design (support) points of the optimal design ( |
w2 |
Vector of corresponding design weights for |
x1 |
Vector of design (support) points of |
w1 |
Vector of corresponding design weights for |
npar |
Number of model parameters. Used when |
prob |
Either |
Details
For a known \theta_0
, relative D-efficiency is
exp(\frac{log|M(\xi_1, \theta_0)| - log|M(\xi_2, \theta_0)|}{npar})
The relative P-efficiency is
\exp(\log(\sum_{i=1}^k w_{1i}p(x_{1i}, \theta_0) - \log(\sum_{i=1}^k w_{2i}p(x{2_i}, \theta_0))
where x_2
and w_2
are usually the support points and the corresponding weights of the optimal design, respectively.
The argument x1
is the vector of design points.
For design points with more than one dimension (the models with more than one predictors),
it is a concatenation of the design points, but dimension-wise.
For example, let the model has three predictors (I, S, Z)
.
Then, a two-point optimal design has the following points:
\{\mbox{point1} = (I_1, S_1, Z_1), \mbox{point2} = (I_2, S_2, Z_2)\}
.
Then, the argument x1
is equal to
x = c(I1, I2, S1, S2, Z1, Z2)
.
Value
A value between 0 and 1.
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.
Examples
p <- c(1, -2, 1, -1)
prior4.4 <- uniform(p -1.5, p + 1.5)
formula4.4 <- ~exp(b0+b1*x1+b2*x2+b3*x1*x2)/(1+exp(b0+b1*x1+b2*x2+b3*x1*x2))
prob4.4 <- ~1-1/(1+exp(b0 + b1 * x1 + b2 * x2 + b3 * x1 * x2))
predvars4.4 <- c("x1", "x2")
parvars4.4 <- c("b0", "b1", "b2", "b3")
# Locally D-optimal design is as follows:
## weight and point of D-optimal design
# Point1 Point2 Point3 Point4
# /1.00000 \ /-1.00000\ /0.06801 \ /1.00000 \
# \-1.00000/ \-1.00000/ \1.00000 / \1.00000 /
# Weight1 Weight2 Weight3 Weight4
# 0.250 0.250 0.250 0.250
xopt_D <- c(1, -1, .0680, 1, -1, -1, 1, 1)
wopt_D <- rep(.25, 4)
# Let see if we use only three of the design points, what is the relative efficiency.
leff(formula = formula4.4, predvars = predvars4.4, parvars = parvars4.4, family = binomial(),
x1 = c(1, -1, .0680, -1, -1, 1), w1 = c(.33, .33, .33),
inipars = p,
x2 = xopt_D, w2 = wopt_D)
# Wow, it heavily drops!
# Locally P-optimal design has only one support point and is -1 and 1
xopt_P <- c(-1, 1)
wopt_P <- 1
# What is the relative P-efficiency of the D-optimal design with respect to P-optimal design?
leff(formula = formula4.4, predvars = predvars4.4, parvars = parvars4.4, family = binomial(),
x1 = xopt_D, w1 = wopt_D,
inipars = p,
type = "PA",
prob = prob4.4,
x2 = xopt_P, w2 = wopt_P)
# .535