本文整理汇总了Python中scipy.special.log1p方法的典型用法代码示例。如果您正苦于以下问题:Python special.log1p方法的具体用法?Python special.log1p怎么用?Python special.log1p使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.special
的用法示例。
在下文中一共展示了special.log1p方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _ppf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _ppf(self, q, h, k):
condlist = [np.logical_and(h != 0, k != 0),
np.logical_and(h == 0, k != 0),
np.logical_and(h != 0, k == 0),
np.logical_and(h == 0, k == 0)]
def f0(q, h, k):
return 1.0/k*(1.0 - ((1.0 - (q**h))/h)**k)
def f1(q, h, k):
return 1.0/k*(1.0 - (-np.log(q))**k)
def f2(q, h, k):
'''ppf = -np.log((1.0 - (q**h))/h)
'''
return -sc.log1p(-(q**h)) + np.log(h)
def f3(q, h, k):
return -np.log(-np.log(q))
return _lazyselect(condlist,
[f0, f1, f2, f3],
[q, h, k],
default=np.nan)
示例2: _pdf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _pdf(self, x, c):
# bradford.pdf(x, c) = c / (k * (1+c*x))
return c / (c*x + 1.0) / sc.log1p(c)
示例3: _cdf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _cdf(self, x, c):
return sc.log1p(c*x) / sc.log1p(c)
示例4: _logcdf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _logcdf(self, x, c, d):
return sc.log1p(-(1 + x**c)**(-d))
示例5: _isf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _isf(self, x, b):
return (sc.log1p(-np.log(x)))**(1./b)
示例6: _logpdf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _logpdf(self, x, c):
return np.log(c) - x - (c+1.0)*sc.log1p(np.exp(-x))
示例7: _loglogcdf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _loglogcdf(self, x, c):
return _lazywhere((x == x) & (c != 0), (x, c),
lambda x, c: sc.log1p(-c*x)/c, -x)
示例8: _sf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _sf(self, x, c):
return np.exp(-c*sc.log1p(x))
示例9: _logsf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _logsf(self, x, c):
return -c*sc.log1p(x)
示例10: _logsf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _logsf(self, x, p):
k = floor(x)
return k*log1p(-p)
示例11: _pmf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _pmf(self, k, p):
return -np.power(p, k) * 1.0 / k / special.log1p(-p)
示例12: _stats
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _stats(self, p):
r = special.log1p(-p)
mu = p / (p - 1.0) / r
mu2p = -p / r / (p - 1.0)**2
var = mu2p - mu*mu
mu3p = -p / r * (1.0+p) / (1.0 - p)**3
mu3 = mu3p - 3*mu*mu2p + 2*mu**3
g1 = mu3 / np.power(var, 1.5)
mu4p = -p / r * (
1.0 / (p-1)**2 - 6*p / (p - 1)**3 + 6*p*p / (p-1)**4)
mu4 = mu4p - 4*mu3p*mu + 6*mu2p*mu*mu - 3*mu**4
g2 = mu4 / var**2 - 3.0
return mu, var, g1, g2
示例13: _ppf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import log1p [as 别名]
def _ppf(self, q, lambda_):
vals = ceil(-1.0/lambda_ * log1p(-q)-1)
vals1 = (vals-1).clip(self.a, np.inf)
temp = self._cdf(vals1, lambda_)
return np.where(temp >= q, vals1, vals)