Good day! I have two gamma distributions, and want to find distribution of their difference. Use np.random.gamma
to generate distribution by parametrs, but result distribution is very different from time to time. Code:
import numpy as np
from scipy.stats import gamma
for i in range(0, 10):
s1 = np.random.gamma(1.242619972, 0.062172619, 2000) + 0.479719122
s2 = np.random.gamma(456.1387112, 0.002811328, 2000) - 0.586076723
r_a, r_loc, r_scale = gamma.fit(s1 - s2)
print(1 - gamma.cdf(0.0, r_a, r_loc, r_scale))
Result:
0.4795655021157602
0.07061938039031612
0.06960741675590854
0.4957568913729331
0.4889900326940878
0.07381963810128422
0.0690800784280835
0.07198551429809896
0.07659274505827551
0.06967441935502583
I recieve two quite different cdf of 0.: 0.48 and 0.07. What can be the problem?
Aucun commentaire:
Enregistrer un commentaire