An Algorithm for Constructing a D-Optimal 2 K Factorial Design for Linear Model Containing Main E ﬀ ects and One-Two Factor Interaction

In this paper an algorithm to construct a D-optimal 2 k factorial design based on the work of (Hedayat & Pesotan, 2007) is developed and coded in a high level computer programming language, JAVA. Our algorithm is able to generate all possible square matrices of order (k + 2) from a 2 k by (k + 2) matrix, select all possible g(k, 1) design matrices of order (k + 2), and hence select a D-optimal design matrix. Furthermore, the computational formulas for the estimation of parameters for the 2 2 and 2 3 designs are derived. The results obtained by our algorithm agree with the theoretical results derived in.


Introduction
A 2 k factorial design is a design involving k-factors each at two levels, low '0' level and high '1' level.As the number of factors k increases, the number of runs required for a complete replicate of the design rapidly outgrows the resources of the experimenters, (Montgomery, 1976).
If certain high order interactions are assumed to be negligible, then information on the main effects and low order interaction may be obtained by running only a fraction of the complete factorial experiments, (Montgomery, 1976).Such designs are widely used in factors screening experiments and many scientific investigations.
The problem is, given k factors each at two levels, to specify a design with at least N = k + 2 level combinations so that N parameters can be estimated unbiased.A number of approaches are available to tackle this problem.(Taguchi, 1959) suggested a graph aided procedure to help construct a suitable fraction.(Greenfield, 1976) suggested a symmetric tree search procedure to select an appropriate design.(Wu/Chen, 1992) also suggested a variant of graph aided procedure.(Hedayat/Pesotan, 1992) Studied 2 k factorial design for main effects and selected two -factor interaction.They introduce the concepts of g(k, e) -design and g(k, e) -matrix to study designs of 2 k experiments which can unbiasedly estimate the mean, the main effects, and a specified two -factor interactions appearing in an orthogonal model.(Hedayat/Pesotan, 2007) Provide tools for the construction of a D-optimal 2 k factorial design for a linear model containing main effects and one two-factor interaction.
The purpose of this paper is to develop an algorithm and computer software to implement the work of (Hedayat/Pesotan, 2007).

The Linear Model
A 2 k factorial design is a set of level combinations, i = (i 1 , i 2 , ..., i k ), i = 1, 2, ..., 2 k , where i j = 0 or 1, j = 1, 2, ..., k.Let y i be the response corresponding to the i th combination level.Then the general linear model containing the main effects and one two -factor interaction as given in (Hedayat/Pesotan, 2007) is where α i := Main effect of factor j α jr := Interaction effect of factor j and factor r μ := Overall mean N = 2 k := number of level cobinatimons x i j = 1, if factor j appears in the i th combination level x i j = −1, if factor j do not appear in the ith combination level e i := random error which is assumed to be normal with mean 0 and constant variance.

The g(k, 1) -Design
In In (Hedayat/Pesotan, 2007), a 2 k factorial design is called a g(k, 1) -design if and only if: (i) It is capable of providing an unbiased estimate for each of the parameters provided by the linear model (2.1), (ii) It is saturated, that is, it contains (k+2) level combinations which corresponds to the number of parameters in the model.
A nonsingular square matrix X of order (k+2) whose entries are -1 and 1 is called a g(k, 1) -matrix if and only if it is in the form, where If -1 is replaced by 0 in the matrix X, a g(k, 1) -design is produced.Thus constructing a g(k, 1) -design is equivalent to constructing a g(k, 1) -matrix.

The D-Optimal Design
Let Ω be a class of all n -square matrices.Then an n -square matrix M is said to be D -optimal in Ω if |M| ≥ |Q|, for any other n -square matrix Q in Ω.
3. Index of interacting Columns of Core Matrix X 1 Let r and s be two columns of X 1 which interact to give W. The product w = ros is called a shur product of r and s.Let f ++ be the frequency of ++ pair between r and s, f +− the frequency of + -pair between r and s, f −+ the frequency of -+ pair between r and s, and f −− the frequency of --pair between r and s.Then the index of r and s is defined as The following lemma is in (Hedayat/Pesotan, 2007).
Lemma Let G (k, 1) be a class of all design matrices g(k, 1).Let T(r, s) be a design matrix, then with the interacting columns r and s, i(r, s) ≥ 1.

The Design of Algorithm
The sequence of steps for our algorithm is as follows: Step 0: Input the number of factors k, the number of combination level N, and N by (k+2) matrix of -1 and 1 entries X, Step 1: from X, where w n = r n os n , r n and s n are the interacting columns of B n .
Step 2: If Yes: Compute det(A n ) and go to step 3.
If No: Go to step 6.
Step 3: If Yes: A n is not a design matrix.Set n: = n + 1 and return to to step 2.
If No: Go to step 4.
Step 4: Compute the frequencies f ++ , f +− , f −+ , and f −− of the interacting columns r and s.
Compute the index i n (r, s) of the interacting columns r and s.
Step 5: If Yes: A n is a design matrix.Set n: = n + 1 and return to to step 2.
If No: A n is not a design matrix.Set n: = n + 1 and return to to step 2.
Step 6: Compute n is a D-optimal 2 k design matrix.Stop.

Example 1: D-Optimal 2 2 factorial Design
There are 4 combination levels in a 2 2 factorial design as shown below: The linear model for this design is as follows: That is, Therefore the normalized matrix X is as follows: In step 0 of our algorithm, k = 2 and X is a 4 by 4 matrix.
In step 1, N = 1, so we have only one 4 by 4 sub-matrix that can be selected from X, and that is X itself.
In step 3, det(A 1 ) 0, so we go to step 4.
In step 4, we compute the index of the interacting columns, column 1 and column 2, of the core matrix as i(1, 2) = 1.
is a D -optimal 2 5 design matrix, and the corresponding unbiased estimates of the parameters μ, α 1 , α 2 , α 3 and α 12 is the solution of the following system of linear equations: That is,

Conclusion
We have studied the work of (Hedayat/Pesotan, 2007) carefully, and then developed an algorithm to implement it.The algorithm so developed is coded in a high level programming language, JAVA.Our algorithm is used in constructing a D-optimal g(2, 1) and g(3, 1)-designs.We observed that a D-optimal design is not unique for k > 2. In particular, for k = 3 there are 36 g(3, 1) D-optimal designs.
The unbiased estimates of the parameters in the linear model for the two designs are obtained, respectively.Since the D-optimal design is not unique for k > 2, the unbiased estimates of the parameters varies from one design to another.One should therefore seek for the D-optimal design that will minimize the sum of squares of the errors.
The program code for our algorithm is available for the interested reader by contacting any of the authors.