tisimst / pyDOE

Design of experiments for Python
BSD 3-Clause "New" or "Revised" License
263 stars 114 forks source link

bbdesign result not consistent with docs #3

Closed hsharrison closed 10 years ago

hsharrison commented 10 years ago

I get this result:

Python 2.7.5+ (default, Sep 19 2013, 13:48:49) 
Type "copyright", "credits" or "license" for more information.

IPython 1.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from pyDOE import *

In [2]: bbdesign(3)
Out[2]: 
array([[-3., -3.,  0.],
       [ 1., -3.,  0.],
       [-3.,  1.,  0.],
       [ 1.,  1.,  0.],
       [-3.,  0., -3.],
       [ 1.,  0., -3.],
       [-3.,  0.,  1.],
       [ 1.,  0.,  1.],
       [ 0., -3., -3.],
       [ 0.,  1., -3.],
       [ 0., -3.,  1.],
       [ 0.,  1.,  1.],
       [ 0.,  0.,  0.],
       [ 0.,  0.,  0.],
       [ 0.,  0.,  0.]])

Instead of this:

Help on function bbdesign in module pyDOE.doe_box_behnken:

...

    Example
    -------
    ::

        >>> bbdesign(3)
        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.]])

The issue seems to be that we're getting -3s instead of -1s. Something similar seems to be happening in ccdesign.

tisimst commented 10 years ago

Thank you for bringing this to my attention. I have looked into the code and fixed the issue. The fixes are available as version 0.3.2 on PyPi.