Exemplo n.º 1
0
 def test_tklmbda_zero_shape(self):
     # When lmbda = 0 the CDF has a simple closed form
     one = mpmath.mpf(1)
     assert_mpmath_equal(
         lambda x: sp.tklmbda(x, 0),
         lambda x: one/(mpmath.exp(-x) + one),
         [Arg()], rtol=1e-7)
Exemplo n.º 2
0
 def test_tklmbda_zero_shape(self):
     # When lmbda = 0 the CDF has a simple closed form
     one = mpmath.mpf(1)
     assert_mpmath_equal(
         lambda x: sp.tklmbda(x, 0),
         lambda x: one/(mpmath.exp(-x) + one),
         [Arg()], rtol=1e-7)
Exemplo n.º 3
0
 def _pdf(self, x, lam):
     lam = numpy.zeros(x.shape) + lam
     output = numpy.zeros(x.shape)
     indices = (lam <= 0) | (numpy.abs(x) * lam < 1)
     lam = lam[indices]
     Fx = special.tklmbda(x[indices], lam)
     Px = 1 / (Fx**(lam - 1.0) + ((1 - Fx))**(lam - 1.0))
     output[indices] = Px
     return output
Exemplo n.º 4
0
 def _pdf(self, x, lam):
     lam = numpy.zeros(x.shape) + lam
     output = numpy.zeros(x.shape)
     indices = (lam <= 0) | (numpy.abs(x)*lam < 1)
     lam = lam[indices]
     Fx = special.tklmbda(x[indices], lam)
     Px = 1/(Fx**(lam-1.0) + ((1-Fx))**(lam-1.0))
     output[indices] = Px
     return output
Exemplo n.º 5
0
 def _cdf(self, x, lam):
     return special.tklmbda(x, lam)
Exemplo n.º 6
0
 def _cdf(self, x, lam):
     return special.tklmbda(x, lam)
Exemplo n.º 7
0
 def _pdf(self, x, lam):
     Fx = (special.tklmbda(x,lam))
     Px = Fx**(lam-1.0) + ((1-Fx))**(lam-1.0)
     Px = 1.0/(Px)
     return np.where((lam <= 0) | (abs(x) < 1.0/(lam)), Px, 0.0)
Exemplo n.º 8
0
 def _pdf(self, x, lam):
     Fx = (special.tklmbda(x,lam))
     Px = Fx**(lam-1.0) + ((1-Fx))**(lam-1.0)
     Px = 1.0/(Px)
     return np.where((lam <= 0) | (abs(x) < 1.0/(lam)), Px, 0.0)