Algorithm Search⌘K

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 N−1N - 1 two-level factors in NN runs, where NN is a multiple of 4. Regular fractional factorial designs need NN 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 NN 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 ±1/3\pm 1/3 for N=12N = 12.

Definition

A Hadamard matrix of order NN is an N×NN \times N matrix HH with entries ±1\pm 1 and HH⊤=NIHH^\top = NI. Changing the sign of a row or of a column keeps this property, so HH can be normalized to have a first column of +1+1 entries.

A Plackett-Burman design with NN runs is the N×(N−1)N \times (N - 1) matrix DD that is left when the first column of a normalized Hadamard matrix is removed. Row uu is a run and column jj is a factor; the entry is the level, −1-1 or +1+1, of factor jj in run uu. With k<N−1k < N - 1 factors, use kk 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 jj is estimated as in a factorial design: E^j=2xj⊤y/N\hat E_j = 2 x_j^\top y/N, the mean response at +1+1 minus the mean response at −1-1.

Theorem 1 (the possible orders). If a Hadamard matrix of order NN exists, then N=1N = 1, N=2N = 2 or NN is a multiple of 4.

Proof. Let N≥3N \ge 3. Normalize the first row to all +1+1 by changing the signs of columns. Take rows 2 and 3 and let a,b,c,da, b, c, d count the columns where they are (+,+)(+, +), (+,−)(+, -), (−,+)(-, +) and (−,−)(-, -). Then a+b+c+d=Na + b + c + d = N; orthogonality to row 1 gives a+b−c−d=0a + b - c - d = 0 and a−b+c−d=0a - b + c - d = 0; and orthogonality of rows 2 and 3 gives a−b−c+d=0a - b - c + d = 0. The only solution is a=b=c=d=N/4a = b = c = d = N/4, so 44 divides NN. □\square

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 X=[1∣D]=HX = [\mathbf 1 \mid D] = H be the model matrix of the main-effect model y=Xb+ey = Xb + e. Then X⊤X=NIX^\top X = NI. So every column of DD has N/2N/2 entries of each sign, the columns are pairwise orthogonal, the estimates E^j\hat E_j are uncorrelated with Var⁡(E^j)=4σ2/N\operatorname{Var}(\hat E_j) = 4\sigma^2/N under independent errors of variance σ2\sigma^2, and any two columns show each of the four level pairs exactly N/4N/4 times. In other words, DD is an orthogonal array of strength 2.

Proof. HH⊤=NIHH^\top = NI means H−1=H⊤/NH^{-1} = H^\top/N, so also H⊤H=NIH^\top H = NI: the columns of HH are orthogonal with squared length NN. A column of DD is orthogonal to the column of ones, so it sums to zero and has N/2N/2 entries of each sign. Least squares gives b^=X⊤y/N\hat b = X^\top y/N with covariance σ2I/N\sigma^2 I/N, and E^j=2b^j\hat E_j = 2\hat b_j. For the pair counts, apply the argument of Theorem 1 to the column of ones and two columns of DD. □\square

Theorem 3 (the cyclic construction of Paley). Let qq be a prime with q≡3(mod4)q \equiv 3 \pmod 4, let χ\chi be the Legendre symbol modulo qq (the quadratic residue character, with χ(0)=0\chi(0) = 0), and let χ′(u)=χ(u)\chi'(u) = \chi(u) for u≠0u \ne 0 and χ′(0)=+1\chi'(0) = +1. Rows i=0,…,q−1i = 0, \dots, q - 1 of DD have the entry χ′(i+j)\chi'(i + j) in column j=0,…,q−1j = 0, \dots, q - 1, and the last row is all −1-1. Then [1∣D][\mathbf 1 \mid D] is a Hadamard matrix of order N=q+1N = q + 1. So the first row has ++ at 00 and at the residues, and each next row is the previous one moved one place to the left.

Proof. Every row has squared length q+1q + 1. First, for d≠0d \ne 0, ∑uχ(u)χ(u+d)=−1\sum_u \chi(u)\chi(u + d) = -1: the term u=0u = 0 is zero, and for u≠0u \ne 0, χ(u)χ(u+d)=χ(u2)χ(1+du−1)=χ(1+du−1)\chi(u)\chi(u + d) = \chi(u^2)\chi(1 + d u^{-1}) = \chi(1 + du^{-1}); as uu runs over the nonzero elements modulo qq, 1+du−11 + du^{-1} takes every value except 1, and ∑zχ(z)=0\sum_z \chi(z) = 0, so the sum is −χ(1)=−1-\chi(1) = -1. Now take rows i≠li \ne l and d=l−id = l - i. With χ′=χ+δ0\chi' = \chi + \delta_0,

1+∑uχ′(u)χ′(u+d)=1+∑uχ(u)χ(u+d)+χ(d)+χ(−d)=1−1+0=0,1 + \sum_u \chi'(u)\chi'(u + d) = 1 + \sum_u \chi(u)\chi(u + d) + \chi(d) + \chi(-d) = 1 - 1 + 0 = 0,

because q≡3(mod4)q \equiv 3 \pmod 4 makes −1-1 a non-residue, so χ(−d)=−χ(d)\chi(-d) = -\chi(d). A row i<qi < q against the last row gives 1−∑uχ′(u)=1−(0+1)=01 - \sum_u \chi'(u) = 1 - (0 + 1) = 0. □\square

For q=11q = 11 the first row is ++-+++---+-, exactly the generator that Plackett and Burman printed for N=12N = 12. For q=19q = 19 it is ++--++++-+-+----++-, their generator for N=20N = 20. The construction also works for prime powers qq with the quadratic character of the field with qq elements, which gives N=28N = 28 from q=27q = 27. The test file checks Theorem 3 for q=3,7,11,19,23,31,43q = 3, 7, 11, 19, 23, 31, 43.

Theorem 4 (partial aliasing). Suppose the true model also has two-factor interactions, E[y]=b0+∑jbjxj+∑a<bbab xa∘xb\mathbb E[y] = b_0 + \sum_j b_j x_j + \sum_{a < b} b_{ab}\, x_a \circ x_b, with effects Ej=2bjE_j = 2b_j and Eab=2babE_{ab} = 2b_{ab}. Then

E[E^i]=Ei+∑a<b, a,b≠iρi,ab Eab,ρi,ab=xi⊤(xa∘xb)N.\mathbb E[\hat E_i] = E_i + \sum_{a < b,\ a, b \ne i} \rho_{i, ab}\, E_{ab}, \qquad \rho_{i, ab} = \frac{x_i^\top (x_a \circ x_b)}{N}.

Proof. E^i=2xi⊤y/N\hat E_i = 2x_i^\top y/N is linear in yy. Orthogonality (Theorem 2) removes b0b_0 and every bjb_j with j≠ij \ne i, and leaves 2bi2b_i. An interaction that contains ii has xi⊤(xi∘xb)=∑uxb(u)=0x_i^\top (x_i \circ x_b) = \sum_u x_b(u) = 0. The other interactions contribute 2babρi,ab2 b_{ab}\rho_{i, ab}. □\square

For the Sylvester designs with N=2mN = 2^m, the product of two columns is another column, so every ρ\rho is 00 or ±1\pm 1: complete aliasing, as in a regular fraction. For N=12N = 12 the test file computes all 11⋅45=49511 \cdot 45 = 495 coefficients in exact arithmetic and finds ρi,ab=±1/3\rho_{i, ab} = \pm 1/3 in every case. This is measured on the design, not proved here for other NN.

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 AA to LL (without II):

run levels of A,B,C,D,E,F,G,H,J,K,LA, B, C, D, E, F, G, H, J, K, L
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 232^3 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 y=50+5xA+3xD+4xAxDy = 50 + 5x_A + 3x_D + 4x_A x_D with no noise, so EA=10E_A = 10, ED=6E_D = 6 and EAD=8E_{AD} = 8. In the 12-run design the responses are 62,62,44,48,48,48,44,46,44,62,46,4662, 62, 44, 48, 48, 48, 44, 46, 44, 62, 46, 46, and the estimates are E^A=10\hat E_A = 10, E^D=6\hat E_D = 6, and ±8/3\pm 8/3 for each of the other nine factors: ρ=±1/3\rho = \pm 1/3 times EAD=8E_{AD} = 8. In the 8-run Sylvester design (the saturated 27−42^{7-4} fraction), the same model gives 1010 and 66 for the two factors and 88 on the one column equal to xAxDx_A x_D, a false main effect as large as a real one, and 00 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 N=8N = 8 the Sylvester matrix H2⊗3H_2^{\otimes 3}, a Kronecker product power whose rows are Walsh-Hadamard functions, gives the saturated 27−42^{7-4} design. The Kronecker product of the 12-run Hadamard matrix with H2H_2 gives a Hadamard matrix of order 24, and the Paley construction with q=23q = 23 gives another.

Example: a code. The rows of a normalized Hadamard matrix HH of order NN and of −H-H, read as 0/1 vectors, form a binary code of 2N2N words with minimum distance N/2N/2, the Hadamard code. For N=12N = 12 it is the non-linear (12,24,6)(12, 24, 6) 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 ±1\pm 1 vectors of length 6 that start with +1+1 and sum to zero are orthogonal.

Non-example: the 12-run design is not a regular fraction. In a regular 2k−p2^{k-p} fraction the product of two columns is again a column, up to sign. In the 12-run design xA∘xBx_A \circ x_B has correlation ±1/3\pm 1/3 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.

  • Fractional factorial design: the regular two-level fractions with 2k−p2^{k-p} runs and complete aliasing.
  • Factorial design: the full 2k2^k design; its model matrix is a Sylvester-Hadamard matrix.
  • Orthogonal array: a Plackett-Burman design is an orthogonal array of strength 2 with NN runs and N−1N - 1 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 q≡3(mod4)q \equiv 3 \pmod 4 give the cyclic generators.
  • Optimal experimental design: among N×NN \times N matrices with entries ±1\pm 1, a Hadamard matrix has the largest determinant, NN/2N^{N/2}, 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.

plackett_burman_design.pyI0RawGitHub
# 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

  1. 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)
  2. 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
  3. 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)
  4. 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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/9V49FC/text.yaml