# bbdesign

Box-Behnken design

## Syntax

``dBB = bbdesign(n)``
``dBB = bbdesign(n,Name=Value)``
``[dBB,blocks] = bbdesign(___)``

## Description

````dBB = bbdesign(n)` returns a numeric matrix `dBB` containing a Box-Behnken design for `n` factors, where `n` is a positive integer scalar greater than or equal to 3. The size of `dBB` is m-by-`n`, where m is the number of runs (points) in the design. Each row of `dBB` contains the settings for all factors in a run, scaled between –1 and 1.```
````dBB = bbdesign(n,Name=Value)` returns `dBB` with additional options specified by one or more name-value arguments. For example, you can specify the number of center points, and the maximum number of points per block.```

example

````[dBB,blocks] = bbdesign(___)` additionally returns a 1-by-m vector containing the block numbers for each run, using any of the input argument combinations in the previous syntaxes. The blocks indicate the runs to measure under similar conditions in order to minimize the effect of inter-block differences on the parameter estimates.```

## Examples

collapse all

Create a three-factor Box-Behnken design with four center points.

`dBB = bbdesign(3,Center=4);`

Display the last five runs of the design.

`disp(dBB(end-4:end,:))`
``` 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 ```

The design contains four center points for a more uniform estimate of the prediction variance over the entire design space.

Visualize the design using the `plot3` function.

```plot3(dBB(:,1),dBB(:,2),dBB(:,3),"ro", ... MarkerFaceColor="b") set(gca,Box="on",BoxStyle="full") axis square equal```

The coordinates of each marked point in the cube represent the factor settings of a run in the design.

## Input Arguments

collapse all

Number of factors in the design, specified as a positive integer scalar greater than or equal to 3.

Example: `3`

Data Types: `single` | `double`

### Name-Value Arguments

Specify optional pairs of arguments as `Name1=Value1,...,NameN=ValueN`, where `Name` is the argument name and `Value` is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: `bbdesign(3,Center=2)` creates a Box-Behnken design for three factors that contains two center points.

Number of center points in the design, specified as a nonnegative integer. The default value depends on `n`.

Example: `Center=3`

Data Types: `single` | `double`

Maximum number of points per block, specified as a positive integer. The default value is `Inf`.

Example: `BlockSize=3`

Data Types: `single` | `double`

## Output Arguments

collapse all

Box-Behnken design for `n` factors, returned as a numeric matrix of size m-by-`n`, where m is the number of runs (points) in the design. Each row of `dBB` contains the settings for all factors in a run, scaled between –1 and 1.

Block numbers for each run (point), returned as an m-by-1 numeric vector, where m is the number of runs in the design. The blocks indicate the runs to measure under similar conditions in order to minimize the effect of inter-block differences on the parameter estimates. For more information, see [1].

## References

[1] Box, G. E. P., W. G. Hunter, and J. S. Hunter. Statistics for Experimenters. Hoboken, NJ: Wiley-Interscience, 1978.

[2] Box, G. E. P., and D. Behnken. "Some New Three Level Designs for the Study of Quantitative Variables." Technometrics 2, no. 4 (November 1960): 455–75.

## Version History

Introduced before R2006a