Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/mainfunctions.R
This function checks the equivalence of two (t-1)
-spreads of PG(n-1,2)
by comparing their sorted bitstring representations.
1 | checkSpreadEquivalence(spread1, spread2)
|
spread1 |
A |
spread2 |
A |
This code checks if two (t-1)
-spreads of PG(n-1,2)
are equivalent using the bitstring representation of Spencer et al. (2019). Both input spreads should be formatted as 3-dimensional arrays, for example, spread1[i,j,k]
indicates whether or not the i
th basic factor is present in the j
th effect of the k
th flat of spread1.
A Boolean indicating whether or not the two spreads are equivalent.
Neil Spencer, Pritam Ranjan, Franklin Mendivil
Spencer, N.A., Ranjan, P., and Mendivil, F., (2019), "Isomorphism Check for 2^n Factorial Designs with Randomization Restrictions", Journal of Statistical Theory and Practice, 13(60),1-24 [https://doi.org/10.1007/s42519-019-0064-5]
checkSpreadIsomorphism
for checking the isomorphism of spreads.
checkStarEquivalence
for checking the equivalence of two stars.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | ## Example 1: two non-equivalent 1-spreads of PG(3,2)
data(spreadn4t2a)
data(spreadn4t2b)
# test their equivalence
(test1 <- checkSpreadEquivalence(spreadn4t2a, spreadn4t2b))
# direct instantiation of a spread
spreadn4t2c <- array(NA, c(4,3,5))
spreadn4t2c[,1,1] <- c(0, 0, 0, 1)
spreadn4t2c[,2,1] <- c(0, 1, 1, 0)
spreadn4t2c[,3,1] <- c(0, 1, 1, 1)
spreadn4t2c[,1,2] <- c(0, 0, 1, 0)
spreadn4t2c[,2,2] <- c(1, 1, 0, 0)
spreadn4t2c[,3,2] <- c(1, 1, 1, 0)
spreadn4t2c[,1,3] <- c(0, 1, 0, 0)
spreadn4t2c[,2,3] <- c(1, 0, 1, 1)
spreadn4t2c[,3,3] <- c(1, 1, 1, 1)
spreadn4t2c[,1,4] <- c(1, 0, 0, 0)
spreadn4t2c[,2,4] <- c(0, 1, 0, 1)
spreadn4t2c[,3,4] <- c(1, 1, 0, 1)
spreadn4t2c[,1,5] <- c(0, 0, 1, 1)
spreadn4t2c[,2,5] <- c(1, 0, 1, 0)
spreadn4t2c[,3,5] <- c(1, 0, 0, 1)
(test2 <- checkSpreadEquivalence(spreadn4t2a, spreadn4t2c))
## Example 2: two equivalent 2-spreads of PG(5,2)
data(spreadn6t3a)
# permute the flats and flat order of spreadn6t3a to create a
# second equivalent spread equiv_spreadn6t3a.
equiv_spreadn6t3a <- spreadn6t3a
dims <- dim(equiv_spreadn6t3a)
for(i in 1:(dims[3])){
equiv_spreadn6t3a[,,i] <- equiv_spreadn6t3a[,sample(1:dims[2], dims[2]),i]
}
equiv_spreadn6t3a <- equiv_spreadn6t3a[,,sample(1:dims[3], dims[3])]
(test3 <- checkSpreadEquivalence(spreadn6t3a, equiv_spreadn6t3a))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.