| CS_MS | R Documentation |
Function to construct a strength 2 CA based on cover starters according to Meagher and Stevens. k and v must be specified, the number of runs is ((v-1)*k+1) (possibly for a larger value of k if the construction does not exist for the requested k)
CS_MS(k, v, start0=TRUE, starter=NULL, ...)
SCA_MS(k, v, start0=TRUE, starter=NULL, ...)
N_CS_MS(t=2, k, v, theoretical=FALSE)
k_CS_MS(t=2, N, v)
k |
number of factors |
v |
number of levels, |
start0 |
should the output design's levels start with zero (default) or 1? |
starter |
an optional cover starter vector. |
... |
currently not used |
t |
requested strength (must be 2, added of unified interface with other N_ and k_ functions) |
theoretical |
logical: default requests size available from using stored cover starters, |
N |
affordable number of runs |
CS_MS returns the smallest possible strength 2 CA from the Meagher/Stevens construction for k experimental factors in v levels; it is an N x k matrix with entries from 0 to v-1 or from 1 to v, depending on start0.
SCA_MS does the same, but arranges the result as an SCA (see Section "Partitioned Covering Array (PCA)" in productPCA).
N_CS_MS returns the minimum run size needed for the Meagher/Stevens construction with k factors at v levels, or NA, if no such construction exists.
k_CS_MS returns the maximum number of v-level factors that can be accommodated in at most N runs, or NA, if no such construction exists.
Meagher and Stevens (2005) denote designs with the factors as the rows and the runs as the columns, this package does the opposite.
The construction uses a starter vector of k elements with first element zero and subsequent elements from 1 to v-1.
These were identified by searches (exhaustive for v <= 10 with v+1 <= k <= 2*(v+1),
hill-climbing for 11<=k<=20). Starter vectors identified by Meagher (2005b) in her thesis,
and in part only provided in the unpublished technical report Meagher (2005a),
are collected in the internal list MeagherStevensStarters,
whose list entry for each v is a list of starter vectors named with k;
search-based vectors for small v (3, 4, 5) have been added.
Note that there can be larger, and in some cases also smaller, starter vectors than the ones listed, which is why function CS_MS
permits the specification of a starter vector.
In search of a starter vector for k+1 if a starter vector for k is available,
inserting a "1" in the second position is often successful (this technique has also been used for finding suitable vectors for cases for which Meagher only asserted existence without providing a vector).
The starter vector is cycled into a k x k matrix M (internal function circular),
which is one key ingredient of the construction. The other key ingredient is the subgroup G of
the symmetric group of permutations of v elements, which cyclically permutes the second to last of the v elements and leaves the first element fixed (i.e., has v-1 elements).
The resulting matrix consists in horizontally concatenating a vector of zeroes with the
v-1 results of applying to M the functions corresponding to a group element
of G.
Group manipulations rely on R package permutations (which uses coding 1 to v).
If there is no starter vector for k in the list for v, the function tries to use the next largest k, if possible. If that is not possible, an error is thrown.
Functions N_CS_MS and k_CS_MS return the minimum N or the maximum
k for the requested scenario. In case of N_CS_MS, the default to use the
available starters can be overridden by the argument theoretical, which allows
to inspect how many runs can be obtained by a suitable user-specified starter vector.
Meagher and Stevens (2005), Meagher (2005a), Meagher (2005b)
## mini example of Meagher / Stevens
k <- 5; v <- 3
# starter <- c(0,1,1,1,2)
CS_MS(5, 3) ## 11 runs
## smallest element of Meagher / Stevens table II
## k = 9, v = 6
D <- CS_MS(9, 6)
dim(D)
coverage(D,2)
## the matrix M from cyclic permutation of the starter vector
MeagherStevensStarters[["6"]][["9"]]
## is treated by cyclic permutation of all levels expect the lowest
## (v-1) k x k matrices
## and a constant column with the lowest level is prepended
## use k=8, which is not directly in the starter table
D <- CS_MS(8, 6)
dim(D) ## works by finding the smallest k that is in the table for v=6
N_CS_MS(k=8, v=6)
N_CS_MS(k=8, v=6, theoretical=TRUE) ## in this case unachievability is proven
N_CS_MS(k=15, v=6) ## not implemented with stored cover starter
N_CS_MS(k=15, v=6, theoretical=TRUE) ## if a cover starter is found and provided,
## 76 runs are possible with the construction
try(D <- CS_MS(14, 6)) ## not implemented
## (though a starter might exist,
## but likely unattractive result)
N_CS_MS(k=15, v=6, theoretical=TRUE) ## 76 runs possible, if suitable starter provided
MeagherStevensStarters[["6"]][["14"]] ## trying a guess for a starter
starter15 <- c(0,1,1,1,1,1,1,1,1,1,2,4,3,1,2)
D <- CS_MS(15, 6, starter=starter15)
coverage(D, 2) ## successful guess
dim(D)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.