Когда я подгоняю scipy.stats.beta
к указанному ниже набору данных c, я получаю отрицательные значения альфа и бета, что является неожиданным, поскольку значения альфа и бета должны быть> 0:
alpha: -6.83775430667913e-05
beta: -8.398959053783684e-05
Вот код:
import scipy.stats as stats
alp, bet, m, st = stats.beta.fit(data)
print(alp, bet, m, st)
Result: -6.83775430667913e-05 -8.398959053783684e-05 -0.1 1.2
Это может быть еще не обработанная ошибка в scipy.stats.beta или optimize.py или minpack.py, которую я не смог отследить. Я получаю массив inf как fsim. Это может быть причиной. Не могли бы вы помочь?
data= [0.686567,0.686567,0.731343,0.835821,0.776119,0.895522,0.850746,0.0149254,0.910448,0.955224,0.955224,0.507463,0.597015,0.626866,0.686567,0.701493,0.731343,0.761194,0.0149254,0.955224,0.970149,0.865672,0.0447761,0.0298507,0.0447761,0.298507,0.567164,0.61194,0.641791,0.0149254,0.850746,0.791045,0.701493,0.0298507,0.0149254,0.0298507,0.0149254,0.0447761,0.0298507,0.0447761,0.0149254,0.716418,0.701493,0.492537,0.0149254,0.0149254,0.0298507,0.0149254,0.0298507,0.0149254,0.0298507,0,0.641791,0.298507,0.0447761,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0298507,0.0447761,0.0149254,0.0298507,0,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0298507,0.0149254,0.0298507,0.0149254,0.0149254,0.0149254,0.0298507,0.0149254,0.0298507,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0,0.0149254,0.0149254,0,0,0.0149254,0.0149254,0.0149254,0.0149254,0.0149254,0,0.492537,0.447761,0.343284,0.253731,0,0,0.0149254,0.0298507,0,0.731343,0.656716,0.641791,0.597015,0.492537,0.447761,0.343284,0.0298507,0.0149254,0.0149254,0.0149254,0.880597,0.791045,0.880597,0.80597,0.731343,0.656716,0.641791,0.0298507,0.0149254,0.253731,0.61194,0.925373,0.880597,0.865672,0.761194,0.880597,0.791045,0.880597,0.0298507,0.343284,0.597015,0.716418,0.940299,0.865672,0.955224,0.895522,0.925373,0.880597,0.865672,0.0298507,0.641791,0.80597,0.80597,0.895522,0.835821,0.955224,0.820896,0.940299,0.865672,0.955224,0.0298507,0.880597,0.761194,0.925373,0.970149,0.865672,0.910448,0.850746,0.895522,0.820896,0.955224,0.0298507,0.865672,0.880597,0.880597,0.985075,0.925373,1,0.910448,0.955224,0.880597,0.925373,0.0149254,0.940299,0.80597,0.910448,0.955224,0.910448,0.985075,0.895522,0.985075,0.925373,0.985075,0.0149254,0.970149,0.850746,0.910448,0.955224,0.895522,0.940299,0.880597,0.940299,0.910448,1,0.0149254,0.895522,0.910448,0.940299,0.835821,0.850746,0.880597,0.910448,0.970149,0.895522,0.955224,0.0149254,0.970149,0.865672,0.940299]
Я получаю следующие предупреждения:
... / scipy / stats / _continuous_distns.py: 515: RuntimeWarning: недопустимое значение, встречающееся в sqrt sk = 2 (ba) np.sqrt (a + b + 1) / (a + b + 2) / np.sqrt (a b) *
... / scipy / optimize / minpack.py: 162: RuntimeWarning: итерация не дает хороших результатов, как показывает улучшение по сравнению с последними пятью оценками Якобиана.
. ../scipy/optimize/optimize.py:596: RuntimeWarning: недопустимое значение в вычитании numpy .max (numpy .abs (fsim [0] - fsim [1:])) <= fatol) </em>