

@staticmethod
def generate_discrete_support(params, support=0.95, nbins=100):
    "\n        returns a set of intervals over which the component model pdf is\n        supported.\n        Inputs:\n            params: a dict with entries 'mu' and 'kappa'\n            nbins: cardinality of the set or the number of grid points in the\n                approximation\n            support: a float in (0,1) that describes the amount of probability\n                we want in the range of support\n        "
    if (type(nbins) is not int):
        raise TypeError('nbins should be an int')
    if (nbins <= 0):
        raise ValueError('nbins should be greater than 0')
    support = check_type_force_float(support, 'support')
    if ((support <= 0.0) or (support >= 1.0)):
        raise ValueError('support is a float st: 0 < support < 1')
    check_model_params_dict(params)
    mu = params['mu']
    kappa = params['kappa']
    assert ((mu >= 0) and (mu <= (2 * math.pi)))
    (a, b) = vonmises.interval(support, kappa)
    a += mu
    b += mu
    assert ((- math.pi) <= a < b <= (3 * math.pi))
    assert ((b - a) <= (2 * math.pi))
    support_range = (b - a)
    support_bin_size = (support_range / (nbins - 1.0))
    bins = [(a + (i * support_bin_size)) for i in range(nbins)]
    return bins

dataset/ETHPy150Open probcomp/crosscat/src/tests/component_model_extensions/CyclicComponentModel.py p_CyclicComponentModel.generate_discrete_support/original