Definitionadvanced
Plackett-Burman design
Also called Plackett-Burman screening design.
Two-level screening designs for N - 1 factors in N runs, N a multiple of 4, built from Hadamard matrices. Main effects are estimated independently of each other.
A Plackett-Burman design studies up to two-level factors in runs, where is a multiple of 4. Regular fractional factorial designs need to be a power of two, so they jump from 8 to 16 to 32 runs. Plackett and Burman (1946) filled the gaps with designs of 12, 20, 24, 28, ... runs. Each design is a Hadamard matrix with its first column removed, so its columns are orthogonal and the main effects are estimated independently, each with the precision of a full factorial of the same size. The price is partial aliasing: when is not a power of two, a two-factor interaction does not fall on one column but spreads over many columns with small weights, such as for .
Definition
A Hadamard matrix of order is an matrix with entries and . Changing the sign of a row or of a column keeps this property, so can be normalized to have a first column of entries.
A Plackett-Burman design with runs is the matrix that is left when the first column of a normalized Hadamard matrix is removed. Row is a run and column is a factor; the entry is the level, or , of factor in run . With factors, use of the columns; the unused "dummy" columns estimate noise when the active effects are few. The runs are done in random order, as in any randomized experiment. The main effect of factor is estimated as in a factorial design: , the mean response at minus the mean response at .
Theorem 1 (the possible orders). If a Hadamard matrix of order exists, then , or is a multiple of 4.
Proof. Let . Normalize the first row to all by changing the signs of columns. Take rows 2 and 3 and let count the columns where they are , , and . Then ; orthogonality to row 1 gives and ; and orthogonality of rows 2 and 3 gives . The only solution is , so divides .
The Hadamard conjecture says that a Hadamard matrix exists for every multiple of 4. It is open; see the Hadamard code page for its status.
Theorem 2 (orthogonality). Let be the model matrix of the main-effect model . Then . So every column of has entries of each sign, the columns are pairwise orthogonal, the estimates are uncorrelated with under independent errors of variance , and any two columns show each of the four level pairs exactly times. In other words, is an orthogonal array of strength 2.
Proof. means , so also : the columns of are orthogonal with squared length . A column of is orthogonal to the column of ones, so it sums to zero and has entries of each sign. Least squares gives with covariance , and . For the pair counts, apply the argument of Theorem 1 to the column of ones and two columns of .
Theorem 3 (the cyclic construction of Paley). Let be a prime with , let be the Legendre symbol modulo (the quadratic residue character, with ), and let for and . Rows of have the entry in column , and the last row is all . Then is a Hadamard matrix of order . So the first row has at and at the residues, and each next row is the previous one moved one place to the left.
Proof. Every row has squared length . First, for , : the term is zero, and for , ; as runs over the nonzero elements modulo , takes every value except 1, and , so the sum is . Now take rows and . With ,
because makes a non-residue, so . A row against the last row gives .
For the first row is ++-+++---+-, exactly the generator that Plackett and Burman printed for . For it is ++--++++-+-+----++-, their generator for . The construction also works for prime powers with the quadratic character of the field with elements, which gives from . The test file checks Theorem 3 for .
Theorem 4 (partial aliasing). Suppose the true model also has two-factor interactions, , with effects and . Then
Proof. is linear in . Orthogonality (Theorem 2) removes and every with , and leaves . An interaction that contains has . The other interactions contribute .
For the Sylvester designs with , the product of two columns is another column, so every is or : complete aliasing, as in a regular fraction. For the test file computes all coefficients in exact arithmetic and finds in every case. This is measured on the design, not proved here for other .
Examples and non-examples
Example: the 12-run design. The cyclic shifts of ++-+++---+- and a row of minus signs give the design for 11 factors, columns to (without ):
| run | levels of |
|---|---|
| 1 | ++-+++---+- |
| 2 | +-+++---+-+ |
| 3 | -+++---+-++ |
| 4 | +++---+-++- |
| 5 | ++---+-++-+ |
| 6 | +---+-++-++ |
| 7 | ---+-++-+++ |
| 8 | --+-++-+++- |
| 9 | -+-++-+++-- |
| 10 | +-++-+++--- |
| 11 | -++-+++---+ |
| 12 | ----------- |
Every column has six and six , and every pair of columns shows , , and three times each. Any three columns contain all 8 level combinations, four of them once and four twice: a full design plus a half fraction. So if at most three factors matter, the experiment contains a full factorial in them. The test file checks all 165 triples.
Example: an interaction, spread or concentrated. Let the response be with no noise, so , and . In the 12-run design the responses are , and the estimates are , , and for each of the other nine factors: times . In the 8-run Sylvester design (the saturated fraction), the same model gives and for the two factors and on the one column equal to , a false main effect as large as a real one, and elsewhere. The 12-run design spreads the interaction thinly; the 8-run design hides it completely behind one factor.
Example: from Sylvester to Plackett-Burman. With the Sylvester matrix , a Kronecker product power whose rows are Walsh-Hadamard functions, gives the saturated design. The Kronecker product of the 12-run Hadamard matrix with gives a Hadamard matrix of order 24, and the Paley construction with gives another.
Example: a code. The rows of a normalized Hadamard matrix of order and of , read as 0/1 vectors, form a binary code of words with minimum distance , the Hadamard code. For it is the non-linear code.
Non-example: 6 runs. No two-level design with 6 runs has 5 orthogonal balanced columns, because a Hadamard matrix of order 6 does not exist (Theorem 1). The test file confirms it directly: no two vectors of length 6 that start with and sum to zero are orthogonal.
Non-example: the 12-run design is not a regular fraction. In a regular fraction the product of two columns is again a column, up to sign. In the 12-run design has correlation with nine columns and equals none of them, so there is no defining relation and no resolution in the regular sense. Its main effects are clear of each other, as in resolution III.
Related definitions
- Fractional factorial design: the regular two-level fractions with runs and complete aliasing.
- Factorial design: the full design; its model matrix is a Sylvester-Hadamard matrix.
- Orthogonal array: a Plackett-Burman design is an orthogonal array of strength 2 with runs and two-level factors, the largest number that the Rao bound allows.
- Hadamard code: the code from the rows of a Hadamard matrix and their negatives.
- Quadratic residue: the residues of a prime give the cyclic generators.
- Optimal experimental design: among matrices with entries , a Hadamard matrix has the largest determinant, , so for the main-effect model a Plackett-Burman design is D-optimal.
Code
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/plackett-burman-design/. The authors are listed in prov/9V49FC.jsonl.
"""Plackett-Burman designs: N runs for up to N - 1 two-level factors, N a multiple of 4.
The design is a normalized Hadamard matrix H (H H^T = N I, first column all +1) without
its first column. Each remaining column has N/2 entries +1 and N/2 entries -1, and any two
columns are orthogonal, so the main effects are estimated independently, each with
variance 4 sigma^2 / N.
"""
from collections.abc import Sequence
# Plackett and Burman's first row for N = 12; the other rows are its cyclic shifts,
# and a last row of all minus signs completes the design.
PB12_GENERATOR = "++-+++---+-"
def cyclic_design(generator: str) -> list[list[int]]:
"""N - 1 cyclic shifts of the generator (row i is the generator shifted left by i),
then a row of -1: the cyclic Plackett-Burman construction."""
g = [1 if c == "+" else -1 for c in generator]
m = len(g)
return [[g[(j + i) % m] for j in range(m)] for i in range(m)] + [[-1] * m]
def is_prime(n: int) -> bool:
return n >= 2 and all(n % d for d in range(2, int(n ** 0.5) + 1))
def paley_design(q: int) -> list[list[int]]:
"""The Plackett-Burman design with N = q + 1 runs for a prime q = 3 (mod 4): the first
row has +1 at the quadratic residues of q and at 0, and -1 at the non-residues."""
if not is_prime(q) or q % 4 != 3:
raise ValueError("q must be a prime with q = 3 (mod 4)")
residues = {(x * x) % q for x in range(1, q)}
gen = "".join("+" if j == 0 or j in residues else "-" for j in range(q))
return cyclic_design(gen)
def sylvester_design(m: int) -> list[list[int]]:
"""The design with N = 2^m runs from the Sylvester-Hadamard matrix (a 2^(k-p) fraction)."""
n = 2 ** m
return [[-1 if bin(r & c).count("1") % 2 else 1 for c in range(1, n)] for r in range(n)]
def is_hadamard(h: Sequence[Sequence[int]]) -> bool:
n = len(h)
return all(len(r) == n and all(v in (1, -1) for v in r) for r in h) and all(
sum(a * b for a, b in zip(h[i], h[j])) == (n if i == j else 0) for i in range(n) for j in range(n))
def with_mean_column(design: Sequence[Sequence[int]]) -> list[list[int]]:
"""The model matrix [1 | D]; for a Plackett-Burman design it is a Hadamard matrix."""
return [[1] + list(r) for r in design]
def main_effects(design: Sequence[Sequence[int]], y: Sequence[float]) -> list[float]:
"""Main effect estimates: mean of y at +1 minus mean of y at -1, column by column."""
n = len(design)
return [2.0 * sum(r[j] * v for r, v in zip(design, y)) / n for j in range(len(design[0]))]
test_plackett_burman_design.py 112 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/plackett-burman-design/. The authors are listed in prov/9V49FC.jsonl.
import random
from fractions import Fraction
from itertools import combinations, product
import pytest
from plackett_burman_design import (
PB12_GENERATOR, cyclic_design, is_hadamard, main_effects, paley_design, sylvester_design,
with_mean_column,
)
def test_pb12() -> None:
d = cyclic_design(PB12_GENERATOR)
assert len(d) == 12 and len(d[0]) == 11
assert is_hadamard(with_mean_column(d))
assert all(sum(col) == 0 for col in zip(*d)) # six + and six - in every column
assert d == paley_design(11) # the PB12 row is the quadratic residues of 11, plus 0
def test_paley_designs() -> None:
for q in (3, 7, 11, 19, 23, 31, 43):
d = paley_design(q)
assert len(d) == q + 1 and is_hadamard(with_mean_column(d))
assert "".join("+" if v > 0 else "-" for v in paley_design(19)[0]) == "++--++++-+-+----++-"
def test_sylvester_designs() -> None:
for m in range(1, 6):
assert is_hadamard(with_mean_column(sylvester_design(m)))
def test_strength_two_projection() -> None:
# every pair of columns shows (+,+), (+,-), (-,+), (-,-) three times each in N = 12
d = cyclic_design(PB12_GENERATOR)
for a, b in combinations(range(11), 2):
pairs = [(r[a], r[b]) for r in d]
assert all(pairs.count(p) == 3 for p in product((1, -1), repeat=2))
def test_partial_aliasing_of_pb12() -> None:
d = cyclic_design(PB12_GENERATOR)
coefs = set()
for i in range(11):
for a, b in combinations([j for j in range(11) if j != i], 2):
coefs.add(Fraction(sum(r[i] * r[a] * r[b] for r in d), 12))
assert coefs == {Fraction(1, 3), Fraction(-1, 3)}
# in the 2^(7-4) design of 8 runs the aliasing is complete: column a times column b is
# the column with label a xor b, so the coefficient is 1 for that column and 0 otherwise
s = sylvester_design(3)
for i in range(7):
for a, b in combinations([j for j in range(7) if j != i], 2):
coef = Fraction(sum(r[i] * r[a] * r[b] for r in s), 8)
assert coef == (1 if (i + 1) == ((a + 1) ^ (b + 1)) else 0)
def test_main_effects_unbiased_without_interactions() -> None:
rng = random.Random(1)
d = cyclic_design(PB12_GENERATOR)
beta = [rng.uniform(-3.0, 3.0) for _ in range(11)]
y = [10.0 + sum(b * x for b, x in zip(beta, r)) for r in d]
assert all(abs(e - 2.0 * b) < 1e-12 for e, b in zip(main_effects(d, y), beta))
def test_no_hadamard_matrix_of_order_six() -> None:
# A normalized Hadamard matrix of order 6 would need 5 rows that start with +1, have
# three +1 entries (orthogonal to the first row) and are pairwise orthogonal.
cands = [v for v in product((1, -1), repeat=6) if v[0] == 1 and sum(v) == 0]
ortho = lambda u, w: sum(a * b for a, b in zip(u, w)) == 0
assert not any(ortho(u, w) for u, w in combinations(cands, 2))
def test_example_interaction_spread_or_concentrated() -> None:
# y = 50 + 5 x_A + 3 x_D + 4 x_A x_D, no noise
d = cyclic_design(PB12_GENERATOR)
y = [50 + 5 * r[0] + 3 * r[3] + 4 * r[0] * r[3] for r in d]
assert y == [62, 62, 44, 48, 48, 48, 44, 46, 44, 62, 46, 46]
est = [Fraction(2 * sum(r[j] * v for r, v in zip(d, y)), 12) for j in range(11)]
assert est[0] == 10 and est[3] == 6
assert [est[j] for j in range(11) if j not in (0, 3)] == [Fraction(s * 8, 3) for s in (-1, 1, 1, 1, -1, -1, -1, -1, -1)]
# the 8-run 2^(7-4) design: column labels 1..7, and A x B is the column labelled 1 xor 2 = 3
s = sylvester_design(3)
y8 = [50 + 5 * r[0] + 3 * r[1] + 4 * r[0] * r[1] for r in s]
est8 = [Fraction(2 * sum(r[j] * v for r, v in zip(s, y8)), 8) for j in range(7)]
assert est8 == [10, 6, 8, 0, 0, 0, 0]
def test_three_column_projection_of_pb12() -> None:
# any 3 columns hold a full 2^3 plus a half fraction: four patterns once, four twice
d = cyclic_design(PB12_GENERATOR)
for t in combinations(range(11), 3):
pats = [tuple(r[i] for i in t) for r in d]
assert sorted(pats.count(p) for p in product((1, -1), repeat=3)) == [1, 1, 1, 1, 2, 2, 2, 2]
def test_hadamard_order_argument() -> None:
# three normalized rows: the column patterns of rows 2 and 3 each occur n/4 times
for h in (with_mean_column(cyclic_design(PB12_GENERATOR)), with_mean_column(paley_design(19))):
n = len(h)
cols = list(zip(*h))
norm = [[v * c[0] for v in c] for c in cols] # make the first row all +1
for i, j in combinations(range(1, n), 2):
pats = [(c[i], c[j]) for c in norm]
assert all(pats.count(p) == n // 4 for p in product((1, -1), repeat=2))
def test_errors() -> None:
with pytest.raises(ValueError):
paley_design(13)
References
- R. L. Plackett and J. P. Burman, The design of optimum multifactorial experiments, Biometrika 33(4), 1946, the article starting on p. 305 (the cyclic generators of the two-level designs for N = 12, 20, 24, ... and the table of designs up to N = 100; page range not confirmed)
- George E. P. Box, J. Stuart Hunter and William G. Hunter, Statistics for Experimenters, second edition, Wiley, 2005, Section 7.1 (Plackett and Burman designs), starting on p. 281
- R. E. A. C. Paley, On orthogonal matrices, Journal of Mathematics and Physics 12, 1933, the construction of Hadamard matrices of order q + 1 from the quadratic residues of a prime power q = 3 (mod 4) (general locator)
- Douglas C. Montgomery, Design and Analysis of Experiments, tenth edition, Wiley, 2019, the chapter on two-level fractional factorial designs, where Plackett-Burman designs appear as non-regular screening designs (chapter-level locator)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag 9V49FC Edit this page History Report an error Markdown