Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintained package (scipy) implementation #23

Open
alexandreCameron opened this issue Aug 23, 2021 · 1 comment
Open

Maintained package (scipy) implementation #23

alexandreCameron opened this issue Aug 23, 2021 · 1 comment

Comments

@alexandreCameron
Copy link

For those looking to upgrade the function to a maintained package:

def get_sequence_using_sobol_seq(n_samples, d):
    from sobol_seq import i4_sobol_generate
    return i4_sobol_generate(d, n_samples).flatten()

is equivalent to

def get_sequence_using_scipy(n_samples, d):
    from scipy.stats.qmc import Sobol
    support_generator = Sobol(d, scramble=False, seed=None).reset()
    # The first value is remove because it's 0
    support = support_generator.random(n=n_samples+1).flatten()[1:]
    return  support
@keithbriggs
Copy link

Correction:

from scipy.stats.qmc import Sobol

def get_sequence_using_scipy(n_samples, d):
    support_generator = Sobol(d, scramble=False, seed=None).reset()
    # The first value is removed because it's 0
    return support_generator.random(n=n_samples+1).flatten()[1:]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants