dirder: Vector of directional derivatives

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/dirder.R

Description

Computes the vector of derivatives at a normalized approximate design w of length n in the directions of singular designs e_i, where i ranges from 1 to n.

Usage

1
dirder(Fx, w, crit="D", h=NULL, echo=TRUE)

Arguments

Fx

the n times m matrix of candidate regressors (as rows), where n is the number of candidate design points and m (where m>=2, m<=n) is the number of parameters.

w

a non-negative vector of length n representing the design. It is normalized prior to the computation of the directional derivatives.

crit

the criterion; possible values are "D", "A", "I", "C" and "c".

h

a non-zero vector of length m corresponding to the coefficients of the linear parameter combination of interest. If crit is not "C" nor "c" then h is ignored. If crit is "C" or "c" and h=NULL then h is assumed to be c(0,...,0,1).

echo

Print the call of the function?

Details

The i-th directional derivative measures the increase of the criterion value provided that we infinitesimally increase the i-th design weight (and decrease other weights by the same proportion). For a concave optimality criterion, an approximate design is optimal in the class of all normalized approximate designs if and only if all its directional derivatives are non-positive. This statement can be rewritten to the form of the so-called equivalence theorem. See the reference paper at http://www.iam.fmph.uniba.sk/design/ for mathematical details.

Value

The vector of directional derivatives of the chosen criterion at w/sum(w) in the direction of the singular designs e_i, where i ranges from 1 to n.

Note

The design w should have a non-singular information matrix.

Author(s)

Radoslav Harman, Lenka Filova

See Also

effbound, varfun

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
# The directional derivatives of the D-optimal approximate design
# for a cubic regression on a square grid.

form.cube <- ~x1 + x2 + I(x1^2) + I(x2^2) + I(x1*x2) +
              I(x1^3) + I(x1^2*x2) + I(x1*x2^2) + I(x2^3)
Fx <- Fx_cube(form.cube, n.levels = c(101, 101))
w <- od_REX(Fx)$w.best

# Because w is optimal approximate, no directional derivative is positive:
boxplot(dirder(Fx, w))

# The yellow values indicate the directional derivative at each design point:
od_plot(Fx, w, Fx[, 2:3])

# An alternative view is a "projection" of the above plot:
od_plot(Fx, w, Fx[, 2], dd.pool = c("max", "min"))

## End(Not run)

OptimalDesign documentation built on March 26, 2020, 9:35 p.m.