(problem, seed=None)
return sample
Generates model inputs using a fractional factorial sample

    Returns a NumPy matrix containing the model inputs required for a
    fractional factorial analysis.
    The resulting matrix has D columns, where D is smallest power of 2 that is
    greater than the number of parameters.
    These model inputs are intended to be used with
    :func:`SALib.analyze.ff.analyze`.

    The problem file is padded with a number of dummy variables called
    ``dummy_0`` required for this procedure. These dummy variables can be used
    as a check for errors in the analyze procedure.

    This algorithm is an implementation of that contained in Saltelli et al
    [`Saltelli et al. 2008 <http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470059974.html>`_]

    Parameters
    ----------
    problem : dict
        The problem definition

    Returns
    -------
    sample : :class:`numpy.array`


    References
    ----------
    .. [1] Saltelli, A., Ratto, M., Andres, T., Campolongo, F., Cariboni, J., Gatelli, D., 
           Saisana, M., Tarantola, S., 2008. 
           Global Sensitivity Analysis: The Primer. 
           Wiley, West Sussex, U.K.
           https://dx.doi.org/10.1002/9780470725184
Generates model inputs using a fractional factorial sample
Generates model inputs using a fractional factorial sample
def sample(problem, seed=None):
    """Generates model inputs using a fractional factorial sample

    Returns a NumPy matrix containing the model inputs required for a
    fractional factorial analysis.
    The resulting matrix has D columns, where D is smallest power of 2 that is
    greater than the number of parameters.
    These model inputs are intended to be used with
    :func:`SALib.analyze.ff.analyze`.

    The problem file is padded with a number of dummy variables called
    ``dummy_0`` required for this procedure. These dummy variables can be used
    as a check for errors in the analyze procedure.

    This algorithm is an implementation of that contained in Saltelli et al
    [`Saltelli et al. 2008 <http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470059974.html>`_]

    Parameters
    ----------
    problem : dict
        The problem definition

    Returns
    -------
    sample : :class:`numpy.array`


    References
    ----------
    .. [1] Saltelli, A., Ratto, M., Andres, T., Campolongo, F., Cariboni, J., Gatelli, D., 
           Saisana, M., Tarantola, S., 2008. 
           Global Sensitivity Analysis: The Primer. 
           Wiley, West Sussex, U.K.
           https://dx.doi.org/10.1002/9780470725184

    """
    if seed:
        np.random.seed(seed)
    contrast = generate_contrast(problem)
    sample = np.array((contrast + 1.) / 2, dtype=float)
    problem = extend_bounds(problem)

    sample = scale_samples(sample, problem)
    return sample
def sample ( problem , seed = None ) : if seed : np . random . seed ( seed ) contrast = generate_contrast ( problem ) sample = np . array ( ( contrast + 1. ) / 2 , dtype = float ) problem = extend_bounds ( problem ) sample = scale_samples ( sample , problem ) return sample