varfun {OptimalDesign} | R Documentation |
Vector of variances
Description
Computes the vector of variances (sensitivities) for a given design w
.
Usage
varfun(Fx, w, crit="D", h=NULL, echo=TRUE)
Arguments
Fx |
the |
w |
a non-negative vector of length |
crit |
the criterion; possible values are |
h |
a non-zero vector of length |
echo |
Print the call of the function? |
Details
For D-optimality, the i-th element of the vector of variances is the variance of the best linear unbiased estimator of the mean value of observations under the experimental conditions represented by the i-th design point (where the variance of the observational errors is assumed to be 1). There is a linear transformation relation of the vector of variances and the vector of directional derivatives for the criterion of D-optimality. See the reference paper at http://www.iam.fmph.uniba.sk/design/ for mathematical details.
Value
The vector of variances (sensitivities) for a given design w
.
Note
The design w
should have a non-singular information matrix.
Author(s)
Radoslav Harman, Lenka Filova
See Also
Examples
# The values of the variance function (for crit=D)
# of D-, I-, and C-optimal approximate design
Fx <- Fx_cube(~x1 + I(x1^2), n.levels = 21)
wD <- od_REX(Fx)$w.best
wI <- od_REX(Fx, crit="I")$w.best
wC <- od_REX(Fx, crit="C", h=c(1, 0, 0))$w.best
vD <- varfun(Fx, wD)
vI <- varfun(Fx, wI)
vC <- varfun(Fx, wC)
plot(Fx[, 2], rep(0, nrow(Fx)), ylim = c(0, max(vD, vI, vC)),
type = "n", xlab = "x", ylab = "var", lwd = 2)
grid()
lines(Fx[, 2], vD, col = "red")
lines(Fx[, 2], vI, col = "blue")
lines(Fx[, 2], vC, col = "green")
# The D-optimal approximate design minimized the maximum
# of the var. function (it is "G-optimal").
# The I-optimal approximate design minimizes the integral of the var. function.
# The C-optimal design with h=f(0) makes the var. function small around 0.