Exemple #1
0
 def __new__(cls, nu, symbol=None):
     nu = sympify(nu)
     x = symbol or SingleContinuousPSpace.create_symbol()
     pdf = 1 / (sqrt(nu) * beta_fn(S(1) / 2, nu / 2)) * (1 + x**2 / nu)**(
         -(nu + 1) / 2)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf)
     return obj
Exemple #2
0
 def __new__(cls, name, nu):
     nu = sympify(nu)
     x = Symbol(name)
     pdf = 1 / (sqrt(nu) * beta_fn(S(1) / 2, nu / 2)) * (1 + x**2 / nu)**(
         -(nu + 1) / 2)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf)
     return obj
Exemple #3
0
    def __new__(cls, alpha, beta, symbol=None):
        alpha, beta = sympify(alpha), sympify(beta)

        _value_check(alpha > 0, "Alpha must be positive")
        _value_check(beta > 0, "Beta must be positive")

        x = symbol or SingleContinuousPSpace.create_symbol()
        pdf = x**(alpha-1) * (1-x)**(beta-1) / beta_fn(alpha, beta)

        obj = SingleContinuousPSpace.__new__(cls, x, pdf, set=Interval(0, 1))
        obj.alpha = alpha
        obj.beta = beta
        return obj
Exemple #4
0
    def __new__(cls, alpha, beta, symbol=None):
        alpha, beta = sympify(alpha), sympify(beta)

        _value_check(alpha > 0, "Alpha must be positive")
        _value_check(beta > 0, "Beta must be positive")

        x = symbol or SingleContinuousPSpace.create_symbol()
        pdf = x**(alpha - 1) * (1 - x)**(beta - 1) / beta_fn(alpha, beta)

        obj = SingleContinuousPSpace.__new__(cls, x, pdf, set=Interval(0, 1))
        obj.alpha = alpha
        obj.beta = beta
        return obj
Exemple #5
0
 def __new__(cls, nu, symbol = None):
     nu = sympify(nu)
     x = symbol or SingleContinuousPSpace.create_symbol()
     pdf = 1/(sqrt(nu)*beta_fn(S(1)/2,nu/2))*(1+x**2/nu)**(-(nu+1)/2)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf)
     return obj
Exemple #6
0
 def dict(self):
     n, a, b = self.n, self.alpha, self.beta
     n = as_int(n)
     return dict(
         (k, binomial(n, k) * beta_fn(k + a, n - k + b) / beta_fn(a, b))
         for k in range(0, n + 1))
Exemple #7
0
 def __new__(cls, name, alpha, beta):
     alpha, beta = sympify(alpha), sympify(beta)
     x = Symbol(name)
     pdf = x**(alpha - 1)*(1 + x)**(-alpha - beta)/beta_fn(alpha, beta)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf, set=Interval(0, oo))
     return obj
Exemple #8
0
 def __new__(cls, name, nu):
     nu = sympify(nu)
     x = Symbol(name)
     pdf = 1/(sqrt(nu)*beta_fn(S(1)/2, nu/2))*(1 + x**2/nu)**(-(nu + 1)/2)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf)
     return obj
Exemple #9
0
 def __new__(cls, alpha, beta, symbol=None):
     alpha, beta = sympify(alpha), sympify(beta)
     x = symbol or SingleContinuousPSpace.create_symbol()
     pdf = x**(alpha - 1) * (1 + x)**(-alpha - beta) / beta_fn(alpha, beta)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf, set=Interval(0, oo))
     return obj
Exemple #10
0
 def pdf(self, x):
     alpha, beta = self.alpha, self.beta
     return x**(alpha - 1) * (1 - x)**(beta - 1) / beta_fn(alpha, beta)
Exemple #11
0
 def __new__(cls, name, alpha, beta):
     alpha, beta = sympify(alpha), sympify(beta)
     x = Symbol(name)
     pdf = x**(alpha-1)*(1+x)**(-alpha-beta)/beta_fn(alpha, beta)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf, set = Interval(0, oo))
     return obj
Exemple #12
0
 def pdf(self, x):
     d1, d2 = self.d1, self.d2
     return (2*d1**(d1/2)*d2**(d2/2) / beta_fn(d1/2, d2/2) *
            exp(d1*x) / (d1*exp(2*x)+d2)**((d1+d2)/2))
Exemple #13
0
 def pdf(self, x):
     d1, d2 = self.d1, self.d2
     return (sqrt((d1*x)**d1*d2**d2 / (d1*x+d2)**(d1+d2))
            / (x * beta_fn(d1/2, d2/2)))
Exemple #14
0
 def pdf(self, x):
     alpha, beta = self.alpha, self.beta
     return x**(alpha - 1)*(1 + x)**(-alpha - beta)/beta_fn(alpha, beta)
Exemple #15
0
 def __new__(cls, alpha, beta, symbol=None):
     alpha, beta = sympify(alpha), sympify(beta)
     x = symbol or SingleContinuousPSpace.create_symbol()
     pdf = x**(alpha-1)*(1+x)**(-alpha-beta)/beta_fn(alpha, beta)
     obj = SingleContinuousPSpace.__new__(cls, x, pdf, set = Interval(0, oo))
     return obj
Exemple #16
0
 def pmf(self, k):
     n, a, b = self.n, self.alpha, self.beta
     return binomial(n, k) * beta_fn(k + a, n - k + b) / beta_fn(a, b)
Exemple #17
0
 def pdf(self, x):
     nu = self.nu
     return 1/(sqrt(nu)*beta_fn(S(1)/2, nu/2))*(1 + x**2/nu)**(-(nu + 1)/2)