I'm doing survival calculations in Scipy and can't get the correct values.
My code:
x, a, c = 1000, 1.5, 5000
vals = exponweib.cdf(x,a,c,loc=0,scale=1)
vals
should equal 0.085559356392783004, but I'm getting 0 instead.
If I define my own function I get the right answer:
def weibCumDist(x,a,c):
return 1-np.exp(-(x/c)**a)
I could just use my own function, but I'm curious as to what I'm doing wrong.
You haven't correctly mapped your parameters to those of scipy. To implement the equivalent of your
weibCumDist
:Note that
exponweib
is the exponentiated Weibull distribution.You probably want to use
scipy.stats.weibull_min
. This is the implementation of the distribution that is often referred to as "the" Weibull distribution: