Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1""" 

2plackett_burman: This module contains tools for designing Plackett-Burman experiments. 

3 

4Plackett and Burman generated sets of useful 2 level experimental designs using a method Raymond 

5Paley identified in 1933. This method generated orthogonal matrices with elements (1, -1). Paley's 

6method could be used to find such matrices of size N for most N equal to a multiple of 4 

7(all such N up to 100 except N = 92). This gave Plackett and Burman the interesting quality that 

8they only increase the number of rows (require runs) in the experiment for every 4 factors added to 

9the design. 

10 

11Plackett and Burman are structured so that each combination of levels for any pair of factors 

12appears the same number of times, throughout all the experimental runs. 

13 

14These designs achieved orthogonality with many fewer runs than a full factorial design. When N is 

15a power of 2 then a Plackett and Burman design is equivalent to a partial factorial resolution III 

16design. All Plackett and Burman designs assume negligible interaction effects relative to main 

17effects. 

18 

19Plackett and Burman do mention designs with more then 2 levels (a rediscovery of methods invented 

20by Raj Chandra Bose and K. Kishen), however these are rarely used in practice. 

21 

22Recommended import style: 

23>>> from lind.design import plackett_burman as pb 

24 

25""" 

26 

27import logging 

28 

29from pandas import DataFrame, read_csv 

30 

31from lind._utilities import _check_int_input 

32from lind import _sfap 

33 

34# set logging 

35logging.basicConfig(level=logging.INFO) 

36logger = logging.getLogger(__name__) 

37 

38# define public functions (ignored by jupyter notebooks) 

39__all__ = ["fetch_plackett_burman_design"] 

40 

41 

42#################################################################################################### 

43 

44 

45def fetch_plackett_burman_design(num_factors: int) -> DataFrame: 

46 """ 

47 fetch_plackett_burman_design 

48 

49 This function helps create Plackett-Burman experimental designs. Plackett-Burman designs are 

50 very efficient screening designs when only main effects are of interest. 

51 

52 Parameters 

53 ---------- 

54 num_factors : int 

55 the number of factors in the design. Currently only supports up to 47 factors per design. 

56 

57 Returns 

58 ------- 

59 pd.DataFrame 

60 experiment design or toc of available designs 

61 

62 Examples 

63 -------- 

64 >>> design = fetch_plackett_burman_design(7) 

65 

66 References 

67 ---------- 

68 NIST 

69 * Section 5.3.3.5 of the Engineering Statistics Handbook 

70 Plackett and Burman 

71 * The Design of Optimum Multifactorial Experiments 

72 

73 """ 

74 

75 _check_int_input(num_factors, "num_factors") 

76 if num_factors > 47: 

77 raise ValueError("This function currently does not support designs with greater than " 

78 "47 factors.") 

79 

80 num_factors = int(num_factors) 

81 design_name = str(4 * (1+num_factors//4)) + ".csv" 

82 if _sfap is None: 

83 raise Exception("Missing dependency lind-static-resources") 

84 return read_csv(_sfap+"/plackett_burman/"+design_name, header=0, index_col=0, 

85 names=["x{}".format(i) for i in range(4 * (1+num_factors//4))] 

86 ).iloc[:, :num_factors]