I am tryng to "translate" from R to Python a code that computed expected frequencies from the Gamma distribution.
More specifically, I have this line of code:
(pgamma(3,shape=a.est,rate=l.est)-pgamma(0,shape=a.est,rate=l.est))*200 that calculate expected frequencies from a gamma distribution of size 200, and shape
a.est <- <-((med.gam)^2)/var.gam and rate
l.est<-avg.gam / var.gam.
I found out in Python the
scipy.stats package, and this is my implementation:
(gamma.cdf(3, a_est, 1/l_est) - gamma.cdf(0, a_est, 1/l_est)) * 200
However, the results are quite different between R and Python, this makes me think I am making some sort of mistakes. Is this way to calculate expected frequencies in python correct?