Learn R Programming

OptimalDesign (version 0.1)

od.print: Print of a design

Description

Prints a table of a given design.

Usage

od.print(w, X=NULL, del=1e-6)

Arguments

w
The non-negative vector of length n representing the design.
X
An n times d real matrix giving the d coordinates of each of the n design points. The argument X can also be NULL; in that case, the non-zero design weights will be printed with their index in 1:n.
del
A small positive number. Each design weight smaller than del will be treated as zero, therefore it will not be displayed in the table.

Details

If supplied, the rows of X represent coordinates of the design points in the d-dimensional design region. The procedure prints a compact table of the design w, excluding the coordinates smaller than del. This is often useful, because the support size of the experimental design (the number of non-zero design weights) is usually much smaller than the size n of the design space.

See Also

od.crit, od.infmat, od.plot

Examples

Run this code
# Print the uniform approximate design on 24 design points in [0, 2*pi].
w1 <- rep(1/24, 24); od.print(w1, seq(0, (46 / 24)* pi, length=24))

# Print an approximate design on 24 design points in [0, 2*pi] 
# with 8 support points.
w2 <- rep(c(1/8, 0, 0), 8); 
      od.print(w2, seq(0, (46 / 24)* pi, length=24))

# Print an approximate design on 24 design points in [0, 2*pi] 
# with 3 support points.
w3 <- rep(c(1/3, rep(0,7)), 3); 
      od.print(w3, seq(0, (46 / 24)* pi, length=24))

# For the trigonometric model of the first degree on the "full circle" 
# discretized to 24 equispaced points, all three designs have the same 
# information matrix:
F.trig <- F.cube(~I(cos(x1)) + I(sin(x1)), 0, (46 / 24)* pi, 24)
round(od.infmat(F.trig, w1), 6)
round(od.infmat(F.trig, w2), 6)
round(od.infmat(F.trig, w3), 6)

Run the code above in your browser using DataLab