python scipy stats cdf beta-pert计算返回nan

时间:2019-03-17 20:36:52

标签: python numpy scipy cdf beta-pert

我正在尝试使用scipy.stats.beta.cdf计算beta-pert,但是只要运行以下代码,它就会返回[nan nan nan nan nan nan nan nan nan]。我需要有关计算beta-pert的帮助。

import scipy
from scipy import stats
from scipy.stats import beta
import numpy as np
import random

random_values = np.random.randint(low=5000, high=625000, size=10)
print ('impart random' + ' ' + str(random_values) )

minimum = 5000
mode = 215000
maximum = 625000

d = (minimum + 4*mode + maximum)/6
print ("intermediate value"  + ' ' + str(d) )
alpha = 6*((d - minimum)/(maximum - minimum))
beta = 6*((maximum - d)/(maximum - minimum))

location = minimum
scale = maximum - minimum

pert = scipy.stats.beta.cdf(random_values, alpha, beta, location, scale)

print ('pert' + ' ' + str(pert))

感谢您的帮助。

0 个答案:

没有答案