Fx_blocks: Matrix of candidate regressors for a block size-two model

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

View source: R/Fx_blocks.R

Description

Creates the matrix of all candidate regressors of a linear regression model corresponding to the problem of the optimal block size-two design.

Usage

1
Fx_blocks(n.treats, blocks=NULL, echo=TRUE)

Arguments

n.treats

the number of "treatments" in the block experiment.

blocks

the 2 times n matrix of all permissible blocks (that is, permissible pairings of treatments). If blocks=NULL, blocks is set to combn(n.treats, 2), which means that all treatment pairings are permissible.

echo

Print the call of the function?

Details

Creates the matrix Fx of artificial regressors, such that the D- and A-optimal designs for the corresponding artificial LRM are are the same as what is called the D- and A-optimal design in the original block model with blocks of size two.

Value

the n times m matrix of all candidate regressors of an auxiliary linear regression model corresponding to the problem of the optimal block size-two design (n is ncol(blocks), m is n.treats-1).

Note

This optimal design problem is equivalent to various optimum-subgraph problems, depending on the criterion.

Author(s)

Radoslav Harman, Lenka Filova

References

Harman R, Filova, L: Computing efficient exact designs of experiments using integer quadratic programming, Computational Statistics and Data Analysis 71 (2014) 1159-1167.

Sagnol G, Harman R: Computing Exact D-optimal designs by mixed integer second-order cone programming, The Annals of Statistics 43 (2015), 2198-2224.

See Also

Fx_cube, Fx_simplex, Fx_glm, Fx_dose, Fx_survival

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
# Compute a D-efficient block size-two design
# with 15 treatments and 10 blocks of size two

Fx <- Fx_blocks(10)
w <- od_KL(Fx, 15, t.max = 5)$w.best
des <- combn(10, 2)[, as.logical(w)]
print(des)


# We can visualize the design as a graph
library(igraph)
grp <- graph_(t(des), from_edgelist(directed = FALSE))
plot(grp, layout=layout_with_graphopt)

## End(Not run)

Example output

[1] Call of the function:
Fx_blocks(n.treats = 10)
[1] Call of the function:
od_KL(Fx = Fx, N = 15, t.max = 5)
[1] Call of the function:
od_REX(Fx = Fx, crit = "D", track = FALSE)
[1] Running od_D_KL for cca 5 seconds starting at 2021-03-25 20:44:51.
[1] The problem size is n=45, m=9, N=15
[1] Setting K=10, L=10
[1] od_D_KL Time: 0 Value: 2.578583 Efficiency: 0.773575
[1] od_D_KL Time: 1 Value: 3.00533 Efficiency: 0.901599
[1] od_D_KL Time: 2 Value: 3.00533 Efficiency: 0.901599
[1] od_D_KL Time: 3 Value: 3.00533 Efficiency: 0.901599
[1] od_D_KL Time: 4 Value: 3.00533 Efficiency: 0.901599
[1] od_D_KL finished after 5 seconds at 2021-03-25 20:44:56
[1] with 1025 restarts and 5312 exchanges.
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,]    1    1    1    2    2    2    3    3    4     4     5     5     6     7
[2,]    3    4    6    6    7    9    5    7    8     9     9    10    10     8
     [,15]
[1,]     8
[2,]    10

Attaching package:igraphThe following objects are masked frompackage:stats:

    decompose, spectrum

The following object is masked frompackage:base:

    union

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