Design of experiments for Python
Project description
The pyDOE package is designed to help the scientist, engineer, statistician, etc., to construct appropriate experimental designs.
Capabilities
The package currently includes functions for creating designs for any number of factors:
2-level full-factorial
Generic full-factorial
Box-Behnken
Central-Composite
The following are in the works (probably), so stay tuned!
Plackett-Burman designs
Fractional-factorial designs
Split-plot designs
Incomplete block designs
D-Optimal designs
Requirements
NumPy
Basic Examples
The main import:
>>> from pyDOE import *
2-Level full-factorial designs (ff2n) only require the number of factors:
>>> ff2n(3) array([[-1., -1., -1.], [ 1., -1., -1.], [-1., 1., -1.], [ 1., 1., -1.], [-1., -1., 1.], [ 1., -1., 1.], [-1., 1., 1.], [ 1., 1., 1.]])
General full-factorial designs (fullfact) require an array of integers, one integer for each factor, where the integer value is the number of levels for that factor:
>>> fullfact([2, 4, 3]) array([[ 0., 0., 0.], [ 1., 0., 0.], [ 0., 1., 0.], [ 1., 1., 0.], [ 0., 2., 0.], [ 1., 2., 0.], [ 0., 3., 0.], [ 1., 3., 0.], [ 0., 0., 1.], [ 1., 0., 1.], [ 0., 1., 1.], [ 1., 1., 1.], [ 0., 2., 1.], [ 1., 2., 1.], [ 0., 3., 1.], [ 1., 3., 1.], [ 0., 0., 2.], [ 1., 0., 2.], [ 0., 1., 2.], [ 1., 1., 2.], [ 0., 2., 2.], [ 1., 2., 2.], [ 0., 3., 2.], [ 1., 3., 2.]])
Box-Behnken designs (bbdesign) require the number of factors and optional number of center points (NOTE: the number of center points is not automatically calculated! It needs to be given explicitly, default = 1):
>>> bbdesign(3, center=5) array([[-1., -1., 0.], [ 1., -1., 0.], [-1., 1., 0.], [ 1., 1., 0.], [-1., 0., -1.], [ 1., 0., -1.], [-1., 0., 1.], [ 1., 0., 1.], [ 0., -1., -1.], [ 0., 1., -1.], [ 0., -1., 1.], [ 0., 1., 1.], [ 0., 0., 0.], [ 0., 0., 0.], [ 0., 0., 0.], [ 0., 0., 0.], [ 0., 0., 0.]])
Central-Composite designs (ccdesign) require the number of factors, an optional number of center points, and an optional type description (i.e. face=... which can be one of:
“circumscribed” or “ccc” (default)
“faced” or “ccf”
“inscribed” or “cci”
(Note: the alpha value for the star points is automatically calculated):
>>> ccdesign(3, face='ccc', center=4) array([[-1. , -1. , -1. ], [ 1. , -1. , -1. ], [-1. , 1. , -1. ], [ 1. , 1. , -1. ], [-1. , -1. , 1. ], [ 1. , -1. , 1. ], [-1. , 1. , 1. ], [ 1. , 1. , 1. ], [-1.68179283, 0. , 0. ], [ 1.68179283, 0. , 0. ], [ 0. , -1.68179283, 0. ], [ 0. , 1.68179283, 0. ], [ 0. , 0. , -1.68179283], [ 0. , 0. , 1.68179283], [ 0. , 0. , 0. ], [ 0. , 0. , 0. ], [ 0. , 0. , 0. ], [ 0. , 0. , 0. ]])
Contact
Any feedback, questions, bug reports, or words of encouragement can be sent to the author.
License
This package is provided under two licenses:
The BSD License
Any other that the author approves (just ask!)
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.