本文整理匯總了Python中scipy.stats.pareto方法的典型用法代碼示例。如果您正苦於以下問題:Python stats.pareto方法的具體用法?Python stats.pareto怎麽用?Python stats.pareto使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scipy.stats
的用法示例。
在下文中一共展示了stats.pareto方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setUp_configure
# 需要導入模塊: from scipy import stats [as 別名]
# 或者: from scipy.stats import pareto [as 別名]
def setUp_configure(self):
from scipy import stats
self.dist = distributions.Pareto
self.scipy_dist = stats.pareto
self.test_targets = set([
'batch_shape', 'entropy', 'event_shape', 'log_prob',
'mean', 'support', 'variance'])
scale = numpy.exp(numpy.random.uniform(
-1, 1, self.shape)).astype(numpy.float32)
alpha = numpy.exp(numpy.random.uniform(
-1, 1, self.shape)).astype(numpy.float32)
scale, alpha = numpy.asarray(scale), numpy.asarray(alpha)
self.params = {'scale': scale, 'alpha': alpha}
self.scipy_params = {'scale': scale, 'b': alpha}
self.support = '[scale, inf]'
示例2: sample_for_test
# 需要導入模塊: from scipy import stats [as 別名]
# 或者: from scipy.stats import pareto [as 別名]
def sample_for_test(self):
smp = numpy.random.pareto(
a=1, size=self.sample_shape + self.shape).astype(numpy.float32)
return smp
示例3: _fit_parametric_family
# 需要導入模塊: from scipy import stats [as 別名]
# 或者: from scipy.stats import pareto [as 別名]
def _fit_parametric_family(dist: stats.rv_continuous, sample: np.ndarray) -> Tuple:
if dist == stats.multivariate_normal:
# has no fit method...
return np.mean(sample, axis=0), np.cov(sample.T, ddof=1)
if dist == stats.t:
fit_kwd = {"fscale": 1}
elif dist in {stats.f, stats.beta}:
fit_kwd = {"floc": 0, "fscale": 1}
elif dist in (stats.gamma, stats.lognorm, stats.invgauss, stats.pareto):
fit_kwd = {"floc": 0}
else:
fit_kwd = {}
return dist.fit(sample, **fit_kwd)