Interface for conference designs
Contains functionality to generate and analyse conference designs. For more information see:
”A Classification Criterion for Definitive Screening Designs”, Schoen et al., The Annals of Statistics, 2019
Author: Pieter Eendebak pieter.eendebak@gmail.com Copyright: See LICENSE.txt file that comes with this distribution
Typedefs
-
typedef CandidateGeneratorConference CandidateGenerator
Functions
-
void print_column(const conference_column &column, const char *msg = 0)
print a candidate extension
-
void showCandidates(const std::vector<conference_column> &column_candidates)
Show a list of candidate extensions
- Parameters:
column_candidates – List of candidates to show
-
array_link conference2DSD(const array_link &conference_design, bool add_zeros = 1)
Convert conference design to definitive screening design
The DSD is created by appending the negated design to the conference design and then appending a row of zeros.
- Parameters:
conference_design – Array with the conference design
add_zeros – If True, then append a row of zeros
- Returns:
The DSD generated from the conference design
-
array_link reduceConference(const array_link&, int verbose = 0)
Reduce conference matrix to normal form using Nauty
See also
-
conference_transformation_t reduceConferenceTransformation(const array_link &conference_design, int verbose)
Reduce conference matrix to normal form using Nauty
The design is converted to a graph representation. The graph is then reduced using Nauty to normal form and the resulting graph translated back to a conference design.
- Parameters:
conference_design – Design to be reduced to normal form
verbose – Verbosity level
- Returns:
A transformation that converts the input design to normal form
-
conference_extend_t extend_conference_matrix(const array_link &design, const conference_t &conference_type, int extcol, int verbose = 1, int maxzpos = -1)
Extend a single conference design with candidate columns
- Parameters:
design – Conference design
conference_type – Type specification for the conference designs
extcol – Index of column to generate extensions for
verbose – Verbosity level
maxzpos – Maximum position of zero in specified design
- Returns:
Structure with information about the possible extensions
-
arraylist_t extend_conference(const arraylist_t &lst, const conference_t conference_type, int verbose, int select_isomorphism_classes = 0)
Extend a list of conference designs with a single column.
The list of conference designs is extended by adding to each design the candidate extentions generated by CandidateGenerator.
The extension algorithm tries to generate designs in LMC0 normal form and prunes any designs that are not in LMC0 form.
- Parameters:
lst – List of conference designs
conference_type – Type specification for the conference designs
verbose – Verbosity level
select_isomorphism_classes – If True then select only a single design for each isomorphism class specified by the conference type.
- Returns:
List of generated conference designs
-
arraylist_t extend_conference_plain(const arraylist_t &lst, const conference_t conference_type, int verbose, int select_isomorphism_classes = 0)
Extend a list of conference designs with a single column, plain version without caching
Research function.
-
arraylist_t extend_conference_restricted(const arraylist_t &lst, const conference_t conference_type, int verbose)
Extend a list of conference designs with a single column
Research function.
-
arraylist_t extend_double_conference(const arraylist_t &lst, const conference_t conference_type, int verbose)
Extend a list of double conference matrices with an additional column
The list of designs is extended by adding each design with the candidate extentions generated by CandidateGeneratorDouble.
- Parameters:
lst – List of double conference designs
conference_type – Type specification for the double conference designs
verbose – Verbosity level
- Returns:
List of generated double conference designs
-
arraylist_t selectConferenceIsomorpismClasses(const arraylist_t &list, int verbose, matrix_isomorphism_t itype = CONFERENCE_ISOMORPHISM)
Select representatives for the isomorphism classes of a list of conference arrays
The method uses Nauty for reduction to normal form and selection of isomorphism classes.
- Parameters:
list – List of designs
verbose – Verbosity level
itype – Specification of the type of isomorphism to use
- Returns:
Selected isomorphism classes
-
std::vector<int> selectConferenceIsomorpismIndices(const arraylist_t &lst, int verbose, matrix_isomorphism_t itype = CONFERENCE_ISOMORPHISM)
select representatives for the isomorphism classes of a list of conference arrays, return indices of classes
-
arraylist_t selectLMC0doubleconference(const arraylist_t &list, int verbose, const conference_t &ctype)
Select double conference designs in LMC0 form
- Parameters:
list – List of double conference designs
verbose – Verbosity level
ctype – Specifiation of the class of designs
- Returns:
List with only the designs in the input list that are in LMC0 normal form.
-
arraylist_t selectLMC0(const arraylist_t &list, int verbose, const conference_t &ctype)
Select conference designs in LMC0 form
- Parameters:
list – List of conference designs
verbose – Verbosity level
ctype – Specification of the class of designs
- Returns:
List with only the designs in the input list that are in LMC0 normal form.
-
std::vector<conference_column> generateConferenceExtensions(const array_link &array, const conference_t &conference_type, int zero_index, int verbose = 1, int filter_symmetry = 1, int filterj2 = 1)
Generate candidate extensions for a conference design
- Parameters:
array – Design to be extended
conference_type – Class of conference designs
zero_index – Index of zero in candidate column
verbose – Verbosity level
filter_symmetry – If True, filter based on symmetry
filterj2 – If True, filter based on J2 values
- Returns:
List of generated extensions
-
std::vector<conference_column> generateConferenceRestrictedExtensions(const array_link &array, const conference_t &conference_type, int zero_index, int verbose = 1, int filter_symmetry = 1, int filterip = 1)
Generate candidate extensions for restricted isomorphism classes
-
std::vector<conference_column> generateDoubleConferenceExtensions(const array_link &array, const conference_t &conference_type, int verbose = 1, int filter_symmetry = 1, int filterip = 1, int filterJ3 = 0, int filter_symmetry_inline = 1)
generate extensions for double conference matrices in LMC0 form
-
std::vector<conference_column> generateSingleConferenceExtensions(const array_link &array, const conference_t &conference_type, int zero_index, int verbose, int filter_symmetry, int filterj2, int filterj3, int filter_symmetry_inline = 0)
generate extensions for conference matrices in LMC0 form
The the method assumes that the input array is in LMC0 format. In particular, the element at row 0 and column 0 of the design should be a zero.
- Parameters:
array – Design to generate extensions for
conference_type – Specification of the type of designs
zero_index – Passed to checkZeroPosition to determine whether a zero in the extension column is in a valid position
verbose – Verbosity level
filter_symmetry – If True than reject extensions which are not minimal according to the row symmetry group of the specified design
filterj2 – If True than reject extensions which do not satisfy the J2 criterea
filterj3 – If True than reject extensions which do not satisfy the J3 criterea
filter_symmetry_inline – Quick rejection of extensions which do not satisfy the symmetry criterion.
- Returns:
List of extensions of the design
-
int maxz(const array_link &al, int column_index = -1)
return max position of zero in array, returns -1 if no zero is found
The parameter k specifies the column to search in. For k=-1 all columns are searched.
-
bool compareLMC0(const array_link &array_first, const array_link &array_second)
Return true if the first array is smaller in LMC-0 ordering than the second array
-
arraylist_t sortLMC0(const arraylist_t &arrays)
sort list of conference designs according to LMC0 ordering
-
lmc_t LMC0checkDC(const array_link &al, int verbose = 0)
-
lmc_t LMC0check(const array_link &array, int verbose = 0)
-
bool isConferenceFoldover(const array_link &array, int verbose = 0)
return true if the design is a foldover array
-
std::vector<int> double_conference_foldover_permutation(const array_link &double_conference)
For a double conference design return a row permutation to a single conference design
If the design is not a foldover design then the first element of the returned permutation is -1.
- Parameters:
double_conference – A double conference design
- Returns:
Permutation such that the top block of the resulting design forms a single conference design
-
int minz(const array_link &al, int column_index)
return minimal position of zero in specified column of a design
-
class conference_t
- #include <conference.h>
Structure representing the type of conference designs.
Public Types
Public Functions
-
conference_t()
Structure representing the type of conference designs
-
conference_t(int N, int k, int j1zero)
Structure representing the type of conference designs
- Parameters:
N – Number of rows
k – Number of columns
j1zero – If True then require the J1-characteristics to be zero
-
conference_t(const conference_t &rhs)
Structure representing the type of conference designs
-
std::string idstr() const
-
array_link create_root() const
create the unique representative of the 2 column conference design in LMC0 form
-
array_link create_root_three_columns() const
create the unique representative of the 3 column conference design in LMC0 form
-
arraylist_t createDoubleConferenceRootArrays() const
create the root arrays with 1 column for the double conference matrices
-
arraylist_t createRootArrays() const
return the list of root arrays for the class of conference designs
-
inline std::string __repr__() const
return string representation of the object
Public Members
-
rowindex_t N
number of runs
-
colindex_t ncols
total number of columns (factors) in the design
-
conference_type ctype
defines the type of designs
-
matrix_isomorphism_t itype
defines the isomorphism type
-
bool j1zero
if true then J1 values should be zero
-
bool j3zero
if true then J3 values should be zero
-
conference_t()
-
class CandidateGeneratorBase
- #include <conference.h>
Class to generate candidate extensions with caching
We assume that the designs to be extended are run ordered, so that the caching has maximal effect.
The key idea used is that any valid extension of a design A with k columns is a permutation of a valid extension of the design B obtained by taking the first l < k columns of A. The permutations that are allowed are called the symmetry inflations. All the j2 checks performed for the extension of B do not have to be repeated for the permutations of this extension.
Subclassed by CandidateGeneratorConference, CandidateGeneratorDouble
Public Functions
-
CandidateGeneratorBase(const array_link &al, const conference_t &ct)
-
void showCandidates(int verbose = 1) const
Show the candidate extensions for each column
-
conference_column_list candidates(int k)
return all candidates for the kth column
Public Members
-
conference_t ct
type of designs to generate
-
int verbose
verbosity level
-
mutable array_link al
last array analyzed
-
mutable int last_valid
index of last valid column
Protected Functions
-
inline int startColumn(const array_link &alx, int verbose = 0) const
Find the starting column for the extension of a design
The static variable START_COL is the number of columns for which is the starting point if the cache is empty. Therefore for a design with initial columns the same, START_COL+1 is the first number of columns with valid entries.
For startcol k the elements in candidate_list[k] are valid, e.g. we can start with extensions valid for index k-1
Protected Attributes
-
mutable std::vector<conference_column_list> candidate_list
list of candidate extensions. the elements of candidate_list[k] correspond to columns with index k-1
Protected Static Attributes
-
static const int START_COL = 2
-
CandidateGeneratorBase(const array_link &al, const conference_t &ct)
-
class CandidateGeneratorConference : public CandidateGeneratorBase
- #include <conference.h>
Class to generate conference candidate extensions.
Public Functions
-
CandidateGeneratorConference(const array_link &al, const conference_t &ct)
-
const std::vector<conference_column> &generateCandidates(const array_link &al) const
Generate a list of candidate extensions for the specified design.
-
std::vector<conference_column> generateCandidatesZero(const array_link &al, int kz) const
generate all candidate extensions with a zero at the specified position
-
CandidateGeneratorConference(const array_link &al, const conference_t &ct)
-
class CandidateGeneratorDouble : public CandidateGeneratorBase
- #include <conference.h>
Class to generate double conference candidate extensions with caching.
Public Functions
-
CandidateGeneratorDouble(const array_link &al, const conference_t &ct)
-
const std::vector<conference_column> &generateCandidates(const array_link &al) const
Generate a list of candidate extensions for the specified design
This method uses symmetry inflation, assumes j1=0 and j2=0. Optimal performance is achieved when the arrays to be extended have identical first columns.
-
CandidateGeneratorDouble(const array_link &al, const conference_t &ct)
-
struct conference_extend_t
- #include <conference.h>
Helper structure containing extensions of conference designs
Public Functions
-
inline conference_column combine(int i, int j) const
list of candidate extensions
-
inline size_t nExtensions() const
-
inline arraylist_t getarrays(const array_link al) const
return the set of extension arrays
Public Members
-
std::vector<conference_column> first
-
std::vector<conference_column> second
list of first block candidate extensions
-
std::vector<conference_column> extensions
list of first block candidate extensions
-
inline conference_column combine(int i, int j) const
-
class DconferenceFilter
- #include <conference.h>
class to filter single or double conference designs
Public Functions
-
DconferenceFilter(const array_link &_als, int filter_symmetry, int filterj2_, int filterj3_ = 1)
-
void show() const
print object to stdout
-
std::vector<conference_column> filterList(const std::vector<conference_column> &lst, int verbose = 0) const
filter a list of columns using the filter method
-
std::vector<conference_column> filterListJ2last(const std::vector<conference_column> &column_list) const
-
std::vector<conference_column> filterListZero(const std::vector<conference_column> &lst) const
filter a list of cperms using the filterZero method
-
bool filter(const conference_column &c) const
return True if the extension satisfies all checks
-
bool filterJpartial(const conference_column &column, int maxrow) const
Filter on partial column (only last col)
- Parameters:
column – Extension column
maxrow – the number of rows that are valid
-
bool filterJ(const conference_column &column, int j2start = 0) const
return True if the extension satisfies all J-characteristic checks
-
bool filterJlast(const conference_column &c, int j2start = 0) const
return True if the extension satisfies all J-characteristic checks for the last columns
-
bool filterReason(const conference_column &column) const
return True if the extension satisfies all checks. prints the reason for returning True or False to stdout
-
bool filterJ3(const conference_column &column) const
return True if the candidate satisfies the J3 check
-
bool filterJ3s(const conference_column &column, int idxstart) const
return True if the candidate satisfies the J3 check for specified pairs
-
bool filterJ3inline(const conference_column &column) const
return True if the candidate satisfies the J3 check
-
bool filterSymmetry(const conference_column &column) const
return True of the candidate satisfies the symmetry check
-
bool filterJ2(const conference_column &c) const
return True of the candidate extension satisfies the J2 check
-
bool filterJ2last(const conference_column &c) const
return True of the candidate extension satisfies the J2 check for the last column of the array checked against
-
bool filterZero(const conference_column &c) const
return True of the candidate extension satisfies the zero check
This means that the first entries of the extension do not contain a zero.
Public Members
-
array_link als
-
int filtersymm
filter based on symmetry
-
int filterj2
filter based on j2 value
-
int filterj3
filter based on j3 value
-
int filterfirst
filter only columns with first value >=0
-
int filterzero
filter based on first occurence of zero in a column
-
mutable long ngood
-
int inline_row
row at which infile filtering is performed
Private Members
-
array_link dtable
table of J2 vectors for J3 filter
-
array_link inline_dtable
table of J2 vectors for inline J3 filter
-
std::vector<int> check_indices
indices to check for symmetry check
-
int minzvalue
used for filtering based on zero
-
DconferenceFilter(const array_link &_als, int filter_symmetry, int filterj2_, int filterj3_ = 1)