cds2.design
Design of experiments: factorial designs and space-filling sampling.
Design of experiments: factorial designs and space-filling sampling.
DesignResult
dataclass
Coded design matrix with factor names and run order.
Source code in src/cds2/design.py
24 25 26 27 28 29 30 | |
full_factorial(levels, factor_names=None, randomize=False, seed=None)
Full factorial design over len(levels) factors.
Rows are coded runs; column 0 cycles fastest and later factors slower
(column j has period prod(levels[:j+1])).
Source code in src/cds2/design.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
fractional_factorial_2k(n_factors, generator=None, randomize=False, seed=None)
Two-level fractional factorial via a defining-relation generator.
generator uses capital letters - e.g. "D=ABC" builds the classic
2^(4-1) half fraction where column D equals the ABC interaction.
Without a generator the full 2^k design is returned.
Source code in src/cds2/design.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | |
latin_hypercube(n_samples, n_dimensions, seed=None, centered=False)
Latin hypercube sample in the unit hypercube [0, 1)^d.
Each dimension is stratified into n_samples equally probable bins
holding exactly one draw - far better coverage than plain Monte Carlo.
Source code in src/cds2/design.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
central_composite(n_factors, alpha=None, face_centered=False)
Face-centred or rotatable central composite design on k factors.
Combines the two-level factorial cube, axial (star) points at +/-alpha and centre points; alpha = (2^k)^(1/4) gives a rotatable design.
Source code in src/cds2/design.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
pluck_factors(design, low, high)
Map coded design levels onto physical factor ranges.
Each design column is rescaled from its own [min, max] span onto [low_j, high_j], so any coding convention (-1/1, 0/1, axial points) maps sensibly onto the real factor ranges.
Source code in src/cds2/design.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |