

@staticmethod
def draw_hyperparameters(X, n_draws=1, gen_seed=0):
    "\n        Draws hyperparameters a, b, and kappa from the same distribution that\n        generates the grid in the C++ code.\n        Inputs:\n             X: a column of data (numpy)\n             n_draws: the number of draws\n             gen_seed: seed the rng\n        Output:\n            A list of dicts of draws where each entry has keys 'a', 'b', 'kappa'.\n        "
    check_data_type_column_data(X)
    if (type(n_draws) is not int):
        raise TypeError('n_draws should be an int')
    if (type(gen_seed) is not int):
        raise TypeError('gen_seed should be an int')
    rng = random.Random(gen_seed)
    samples = []
    N = float(len(X))
    vx = numpy.var(X)
    a_kappa_draw_range = (vx, (vx / N))
    mu_draw_range = (0, (2 * pi))
    for i in range(n_draws):
        a = math.exp(rng.uniform(a_kappa_draw_range[0], a_kappa_draw_range[1]))
        kappa = math.exp(rng.uniform(mu_draw_range[0], a_kappa_draw_range[1]))
        b = rng.uniform(mu_draw_range[0], mu_draw_range[1])
        this_draw = dict(a=a, b=b, kappa=kappa)
        samples.append(this_draw)
    assert (len(samples) == n_draws)
    return samples

dataset/ETHPy150Open probcomp/crosscat/src/tests/component_model_extensions/CyclicComponentModel.py p_CyclicComponentModel.draw_hyperparameters/VarMisuse@167/380 `a_kappa_draw_range`->`mu_draw_range`