View source: R/recursiveBoseHartman.R
| recursiveBoseHartman | R Documentation |
applies construction principle of Hartman (2005) Thm 7.1 and Corollary 7.2
recursiveBoseHartman(q, A=NULL, d=NULL, ...)
N_k_recursiveBoseHartman_A(q, A, ...)
N_k_recursiveBoseHartman_d(q, d=2, ...)
N_d_recursiveBoseHartman(q, k, ...)
q |
a prime or prime power number of levels |
A |
|
d |
|
... |
currently not used |
k |
the number of columns requested |
recursiveBoseHartman returns a uniform strength 2 CA with q level columns.
If neither A nor d are specified,
the result has 2q^2 - q rows and q^2 + q + 1 columns,
levels are coded from 0 to q - 1.
If A is specified, the result has N + q^2 - q rows and q*k + q + 1 columns,
in the same coding as A.
If d is specified and A=NULL,
the result has d*q^2 - (d-1)*q rows and sum_i=0^d q^i columns,
coded from 0 to q-1.
N_k_recursiveBoseHartman_A returns a named vector with the run size N and the number of columns k for given q and A.
k_recursiveBoseHartman returns the number of columns k for given q and d.
N_d_recursiveBoseHartman returns a named vector with the run size N, the d for its creation for the requested number of columns k, and the maximum possible number of columns kmax for that construction.
The function uses a method presented by Hartman (2005) (Theorem 7.1 and Corollary 7.2).
For A=NULL, the function uses lhs::createBose(q, q+1, bRandom=FALSE) for creating A
The user can specify any uniform strength 2 CA for A; the extension to more columns and runs will always use the Bose OA without the first q rows, and thus always add q^2-q rows.
dim(D <- recursiveBoseHartman(3))
eCAN(2,13,3) ## optimal
dim(recursiveBoseHartman(3, d=2))
dim(D2 <- recursiveBoseHartman(3, D))
eCAN(2,40,3) ## reasonably close to optimal
dim(recursiveBoseHartman(3, d=3))
dim(D3 <- recursiveBoseHartman(3, D2))
eCAN(2,121,3) ## still reasonably close to optimal
dim(recursiveBoseHartman(3,d=4))
## constructions with A=NULL are optimal
for (q in c(4,5,7,9,11,13,16)){
D <- recursiveBoseHartman(q)
cat(paste0("q=", q, "\n"))
cat(paste0("constructed: ",
paste(paste0(c("N=","ncolumns="),dim(D)), collapse=", "), "\n"))
Nopt <- eCAN(2,ncol(D),q)[1] ## optimal
cat(paste0("optimal for ", ncol(D), " columns: ", Nopt, " runs\n"))
}
#' ## constructions of first recursion are optimal or reasonably close
for (q in c(4,5,7,9,11,13,16)){
D <- recursiveBoseHartman(q)
D <- recursiveBoseHartman(q, D)
cat(paste0("q=", q, "\n"))
cat(paste0("constructed: ",
paste(paste0(c("N=","ncolumns="),dim(D)), collapse=", "), "\n"))
Nopt <- eCAN(2,ncol(D),q)[1] ## optimal
cat(paste0("optimal for ", ncol(D), " columns: ", Nopt, " runs\n"))
}
## a general A, an OA in 11 5-level columns at strength 2
## coded starting with 1
A <- matrix(as.numeric(as.matrix(
DoE.base::oa.design(nlevels=rep(5,11), randomize=FALSE))),
nrow=50)
head(A)
## number of columns increased from 11 to 56
## number of rows increased by 5^2 - 5 = 20
## still strength 2
dim(D <- recursiveBoseHartman(5, A))
coverage(D, 2, start0=FALSE)
## 25% more runs than the best CA
eCAN(2,56,5)
## recursive with d=1
recursiveBose(3,d=1)
## query functions
N_k_recursiveBoseHartman_A(4, lhs::createBose(4, 5))
N_k_recursiveBoseHartman_d(4,4)
N_d_recursiveBoseHartman(4, 12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.