So welcome back to our module that talks about response surface methods, and recall that we've said that response surface methods very often make use of second-order models and designs for fitting those second-order models. I want to talk for a little bit about blocking in the second-order design. Frequently, we do need to block a second-order design for a couple of reasons. One is that sometimes your second-order design is built up from a first-order design. So you already have the runs for the first-order design and they were taken at some previous time period and now you're going to add runs to that design so that you can fit the second-order model. So you naturally have two time periods or two situations in which you might want to consider blocking. The other time that second-order designs could possibly benefit from blocking is when the design is fairly large. Because some second-order designs when you have more than two or three factors, can be large and the necessity to run those in blocks could be a situation that occurs often. Well, it turns out that for any second-order design to block orthogonally, it's pretty easy to find conditions for which has to be satisfied for that to happen. Here are the two conditions. They're really simple to state. Condition 1 is that each block of the design must be a first-order orthogonal design. So each block of your second-order design must be an orthogonal first-order design. That's easy to check. All you have to do is make sure that the sum of the cross products of all the columns is equal to zero. Then the second condition is sometimes a little trickier, but it basically says that the fraction of the total sum of squares for each variable contributed by every block must be equal to the fraction of the total number of observations that occur in that block. So look at the equation you see down at the bottom of the slide. This is the sum of the squares of all of the observations in a particular block divided by the sum of the squares of the observations for a particular factor across the entire design. This is the ratio of the number of observations in that block to the total number of runs in the design. It's, in many cases, very easy to see that those conditions are satisfied. Central composite designs, it's extremely easy to do this. This is a central composite design. It's a rotatable CCD, two variables with 12 runs, and Block 1, this consists of the factorial runs plus two center runs. Block 2 consists of the axial portion plus two center runs. Well, if you look at the Block 1, it's clear that this is an orthogonal first-order design. It's a two square with two center points. Now look at Block 2, and it's pretty clear that sum of the cross-product of those two columns is zero. So you have an orthogonal first-order design in the first block and an orthogonal first-order design in the second block. Now to verify condition 2, take the sum of the squares of x_1 in Block 1 and it turns out to be four. Now get the sum of the squares of x_1 for the entire design and it turns out to be eight. So the ratio is four to eight, and that's exactly the same ratio as the number of runs. The same thing is true for x_2. So the conditions are satisfied here, for condition 1 and condition 2. So this design blocks orthogonally. Can you guess how you would run a central composite design in three blocks? What would you do? Well, you would break the factorial portion into two blocks and then the axial portion would be the third block. In general, you could break the axial portion into two to the P blocks if necessary, with the axial portion being the last block. So it's always very easy to get these designs setup so that you can arrange them in blocks. Many computer software packages will do blocked versions of the central composite design for you. That'll be one of the choices that you can select. So now let's talk a little bit more about optimal or computer-generated designs. Well, this topic has come up a couple of times in the course and I always like to come back to it again, particularly when we have a place where it fits nicely. Response surface methods are a place where optimal designs can definitely be useful. Remember that in general, optimal designs are good choices whenever you have either an unusual experimental region, something that's not standard, it's not a cube or sphere, or the model that you want to choose is not a standard model, or there are some unusual sample size or blocking requirements that enter into your problem. In those situations, optimal designs are really the way to go. In fact, I believe that in many cases, optimal designs are very good alternatives to standard designs because standard designs are themselves either optimal or very nearly optimal. We always create these optimal designs with a computer algorithm. That's why we sometimes call them computer-generated designs. What we do is we specify an optimality criterion and then we use computer software to create the design. Several popular design optimality criteria, which we've talked about before. Probably the most widely known and maybe the most widely used is the D-optimal criteria. Design is said to be D-optimal if it maximizes the determinant of X prime X or if it minimizes the determinant of X prime X inverse. Those are equivalent statements. Basically, what a D-optimal design does is it minimizes the volume of the joint confidence region on your vector of regression coefficients. If we have two designs, design 1 and design 2 and we want to measure the relative efficiency of one design to the other, say design 1 to design 2. Then if we are using the D criteria, equation 11.21 is how we would calculate the D efficiency. Notice it's the ratio of the determinant of design two to the determinant of design one raised to the one over p power. Here, X_1 and X_2 are the X matrices for the two designs, p is the number of model parameters. Many popular software packages construct the optimal designs, and they very often report D-efficiency for the design that they find and equation 11.21 is how they calculate that D-efficiency. By the way, in the event they don't have a known D-optimal design to compare their design to the way they would do that is by assuming that the optimal design is an orthogonal design. So that means that in some cases, we don't know what the optimal design is or there's not an orthogonal design that's available and so we just assume that there is one. So the D-efficiency that you get can be really just an estimate of the D-efficiency and not really the true D-efficiency. The D criteria of course is prediction is estimation oriented. It has to do with the precision with which your regression coefficients are estimated. There are situations where we would be interested in prediction variance, not the estimation efficiency, but the prediction variance criteria or as I say, practically very interesting. The most popular of these, the one that's the most well known is G-optimality and the design is said to be G-optimal if it minimizes the maximum prediction variants or maximum scaled prediction variance over the design region and this is the scaled prediction variance. We take the variance of y hat, the point x, multiply by N and divide by Sigma squared. If the design minimizes the maximum value of that, then we have a G-optimal design. If the model has p parameters, then the G-efficiency of an arbitrary design is just p divided by the maximum value of the scale prediction variance over the region for the design that you are computing the G-efficiency for. So this would be your candidate design and this would be the best value of prediction variants that you could possibly achieve. There's another criteria that I like quite a bit, but it's not one that's necessarily easy to compute and that's the V criteria. What the V criteria does is it takes a set of points of interest in your design space and then it gets the average prediction variants over that set of arbitrary points. Now that's really hard to deal with and of course, coming up with the set of points could be a little arbitrary as well. So a better criteria is the I criteria which is the average or integrated variants criteria. What this does is instead of calculating the prediction variants at a finite set of points and then averaging, it computes the average or the integrated variance over the entire design space and that's what this equation is doing. R is the design region where we're integrating the prediction variance over the design region, R and A is the volume of that region. So this is a general form of the average prediction variance, probably a little bit more general form that was discussed back in Chapter 6. Sometimes the I criteria is called the IV criteria for integrated variants, sometimes it's called the Q criteria. But JuMP and design expert in Minitab or software packages that could construct I optimal designs. So which criteria should you use? Good question. I believe if you're fit in a first-order model, D is a very good choice because there your focus should be on estimating parameters. These designs are largely used for screening experiments and getting good, highly precise estimates of your model parameters is important. On the other hand, for fitting a second-order model, I think I is a good choice because in second-order models, our focus is primarily on response prediction and optimization and so the I criteria to me, is a very good choice when we're running an experiment whose purposes is prediction or optimization. Algorithms. There are two basic algorithms that are used to do this. One of them is point exchange. This requires a candidate set of possible points that you would be willing to use in the design and usually this candidate set is larger than the number of runs that you would think about using in your design. Then you choose a design at random from the candidate set and you evaluate the D criteria, then you do it again. You choose many random restarts and you calculate a design by exchanging points that are in your design with unassigned points from the candidate set and when you found is good a design as you can find, you stop and then you save the D criteria for that design and then you do it again. You might do 100 or 1,000 or 5,000 random starts. If you do a lot of random starts, this generally ensures that you get a really highly-efficient design. This is the way we largely did this for quite a few years. But since the mid 90s, most computer software packages have switched over to using coordinate exchange. In coordinate exchange, we don't have a candidate set. We simply create a random design of the correct size and then we search over every single coordinate. That is, we start with run number 1, coordinate number 1, and we search over that until we found the best setting for that coordinate in terms of our optimality criteria. Then we move to the second coordinate and we do that for every coordinate, for every run and when we get to the last one, we're done. Then we go back and we start again at the first run and the first coordinate and we continue doing these coordinate searches until we can make no further improvement. Then we save that design and its optimality criteria, we generate another random design for a starting point and we repeat the process, and again, we do a lot of random starts, maybe 1,000, maybe 5,000 random starts and we typically will find a very good design if we don't find the optimal design. Coordinate exchange is generally more efficient both in terms of computing and in terms of the quality of the designs that you find in comparison to point exchange. So very few modern programs really use point exchange anymore. Virtually everybody uses coordinate exchange and that's the way I would recommend doing this.