def __init__(self, rate=1): """Create Exp(rate) distribution. :param rate First shape parameter of exp """ assert rate > 0 self.rate = rate self.UG = UniformDist() super().__init__(ContinuousSpace(0, np.inf, open_brackets=False))
def __init__(self, shape=1, scale=1): """Create Ga(shape,scale) distribution. :param shape Shape of Ga(shape,scale) :param scale Scale of Ga(shape,scale) """ self.shape = shape self.scale = scale self.UG = UniformDist() if shape >= 1: self.NG = NormalDist() super().__init__(ContinuousSpace(0, np.inf, open_brackets=False))
def __init__(self, mean=0, var=1): """Create LogN(mean, var) distribution. :param mean Center of the gaussian :param var Variance around the center. """ self.mean = mean self.var = var # create random generators self.NG = NormalDist(mean, var) super().__init__(ContinuousSpace(0, np.inf))
def __init__(self, m=1, n=1): """Create F(m,n) distribution. :param m Degrees of freedom :param n Degrees of freedom """ # save params self.m = m self.n = n self.BG = BetaDist(m / 2, n / 2) super().__init__(ContinuousSpace(0, np.inf, open_brackets=False))
def __init__(self, mean=0, var=1): """Create N(mean, var) distribution. :param mean Center of the gaussian :param var Variance around the center. """ self.mean = mean self.var = var # create random generators self.EG = ExpDist() self.UG = UniformDist() super().__init__(ContinuousSpace(-np.inf, np.inf))
def __init__(self, loc=1, scale=1): """Creates Gumbel(loc,scale) distribution. :param loc Location of the distribution. :param scale Scale of the distribution """ # save params self.loc = loc self.scale = scale # create generator self.UG = UniformDist() super().__init__(ContinuousSpace(-np.inf, np.inf))
def __init__(self, v = 1, loc = 0, scale = 1): """Create t(v,loc,scale) distribution. :param v Degrees of Freedom """ # save params self.v = v self.loc = loc self.scale = scale # create generator self.UG = UniformDist() super().__init__(ContinuousSpace(-np.inf, np.inf))
def __init__(self, shape=1, scale=1): """Creates Pareto(shape,scale) distribution. :param shape Shape of the distribution. :param scale Scale of the distribution """ # save params self.shape = shape self.scale = scale # create generator self.UG = UniformDist() super().__init__(ContinuousSpace(0, np.inf, open_brackets=False))
def __init__(self, loc=0, scale=1): """Creates Laplace(loc,scale) distribution. :param loc Location of the distribution. :param scale Scale of the distribution """ # save params self.loc = loc self.scale = scale # create generator self.NG = NormalDist() self.EG = ExpDist() super().__init__(ContinuousSpace(-np.inf, np.inf))
def __init__(self, a=1, b=1): """Create Beta(a,b) distribution. :param a First shape parameter of beta :param b Second shape parameter of beta """ assert a > 0 and b > 0 # save params self.a = a self.b = b # create two distributions when one wants to sample self.GaG = GammaDist(self.a, 1) self.GbG = GammaDist(self.b, 1) # define the space of the distribution super().__init__(ContinuousSpace(0, 1))