Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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))
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 10
0
 def pdf(self, x):
     alpha, beta = self.alpha, self.beta
     return x**(alpha - 1) * (1 - x)**(beta - 1) / beta_fn(alpha, beta)
Esempio n. 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
Esempio n. 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))
Esempio n. 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)))
Esempio n. 14
0
 def pdf(self, x):
     alpha, beta = self.alpha, self.beta
     return x**(alpha - 1)*(1 + x)**(-alpha - beta)/beta_fn(alpha, beta)
Esempio n. 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
Esempio n. 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)
Esempio n. 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)