You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Generates a fractional factorial design matrix from a generator string.
151
+
*
152
+
* <p>
153
+
* This method creates a design matrix for a fractional factorial experiment based on a user-provided generator string.
154
+
* The generator string defines main factors and combination factors, optionally with a leading '+' or '-' sign for
155
+
* combination factors. Each main factor is treated as a 2-level factor (-1 and +1). Combination factors are computed
156
+
* as the row-wise product of the relevant main factor columns, with signs applied if specified.
157
+
* </p>
158
+
*
159
+
* <p>
160
+
* The resulting matrix includes:
161
+
* <ul>
162
+
* <li>Main factor columns: each column corresponds to a main factor, populated using a 2-level full factorial design.</li>
163
+
* <li>Combination factor columns: each column is calculated by multiplying the main factor columns involved in that combination, with an optional leading sign applied.</li>
164
+
* </ul>
165
+
* </p>
166
+
*
167
+
* <p>
168
+
* Example generator strings:
169
+
* <ul>
170
+
* <li>"a b ab" – two main factors a, b, and one combination factor ab.</li>
171
+
* <li>"a b -ab" – two main factors a, b, and one combination factor ab with a negative sign applied.</li>
172
+
* </ul>
173
+
* </p>
174
+
*
175
+
* <p>
176
+
* Steps performed by this method:
177
+
* <ol>
178
+
* <li>Validate the generator string using {@link FactorialUtility#validateGeneretor(String)}.</li>
179
+
* <li>Parse the generator into main factors and combination factors.</li>
180
+
* <li>Generate a 2-level full factorial design for the main factors.</li>
181
+
* <li>Populate the final design matrix with main factor values.</li>
182
+
* <li>For each combination factor, compute the row-wise product of its associated main factor columns.</li>
183
+
* <li>If a leading sign ('+' or '-') exists for a combination factor, apply it to the computed product.</li>
184
+
* <li>Populate the final design matrix with the computed combination factor values.</li>
185
+
* <li>Log the final matrix for inspection.</li>
186
+
* </ol>
187
+
* </p>
188
+
*
189
+
* <p>
190
+
* Notes:
191
+
* <ul>
192
+
* <li>The number of rows in the final matrix is 2^k, where k is the number of main factors.</li>
193
+
* <li>The number of columns equals the total number of factors in the generator string (main + combination).</li>
194
+
* <li>Combination factors can involve multiple main factors.</li>
195
+
* <li>Leading '+' signs are optional and do not modify the product; leading '-' signs negate the product.</li>
196
+
* </ul>
197
+
* </p>
198
+
*
199
+
* @param generetor
200
+
* A generator string defining main factors and combination factors. Main factors are single letters,
201
+
* combination factors are multiple letters possibly prefixed with '+' or '-' to indicate sign.
202
+
*
203
+
* @throws IllegalArgumentException
204
+
* If the generator string is invalid according to {@link FactorialUtility#validateGeneretor(String)}.
0 commit comments