Skip to main content

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:

  1. 2-level full-factorial

  2. Generic full-factorial

  3. Box-Behnken

  4. Central-Composite

The following are in the works (probably), so stay tuned!

  1. Plackett-Burman designs

  2. Fractional-factorial designs

  3. Split-plot designs

  4. Incomplete block designs

  5. 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:

  1. “circumscribed” or “ccc” (default)

  2. “faced” or “ccf”

  3. “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:

  1. The BSD License

  2. Any other that the author approves (just ask!)

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyDOE-0.1.alpha.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file pyDOE-0.1.alpha.tar.gz.

File metadata

  • Download URL: pyDOE-0.1.alpha.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyDOE-0.1.alpha.tar.gz
Algorithm Hash digest
SHA256 3b1f21477c6a3d133952c4a132076d3f18cfb32c77c48efef76515ee91c48dff
MD5 969c0a33ac9fc78227d0fad2584f87ce
BLAKE2b-256 667f53a882fba583d9f9174b8e21e7aee7b8758d731a4ea812d811e55b807aa2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page