You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your __init__.py file references the Weibull distribution on line 620 but in reality calls the exponentiated Weibull distribution (exponweib function) from scipy.stats on line 1035. This can be confusing to an unsuspecting user. The attached python script demonstrates the problem.
# import librariesimportscipy.statsasspsimportsoerpassrpimportscipy.specialasspp# define lamda and k parameterslamda=4k=6# calculate EXPONENTIATED Weibull distribution mean using soerpres1=srp.Weib(lamda=lamda, k=k).mean# calculate Weibull distribution mean using the analytic solutionres2=lamda*spp.gamma(1+1/k)
# calculate Weibull distribution mean using scipy.statsres3=sps.weibull_min.mean(c=k, scale=lamda, loc=0)
# calculate Weibull distribution mean using soerp's uv functionres4=srp.uv(rv=sps.weibull_min(k, scale=lamda, loc=0)).mean# and print the resultsprint(res1, "\t", res2, "\t", res3, "\t", res4)
I think that the following patch rectifies the situation.
--- __init__.py.OLD 2017-02-25 09:24:55.965982600 -0600+++ __init__.py 2017-03-19 14:58:39.587601800 -0500@@ -582,7 +582,7 @@
+---------------------------+-------------+-------------------+-----+---------+
| Student-T(v) | t | v | | |
+---------------------------+-------------+-------------------+-----+---------+
- | Weibull(lamda, k) | exponweib | lamda, k | | |+ | Weibull(lamda, k) | weibull_min | k | | lamda |
+---------------------------+-------------+-------------------+-----+---------+
Thus, each distribution above would have the same call signature::
@@ -1032,7 +1032,7 @@
The shape parameter
"""
assert lamda>0 and k>0, 'Weibull scale and shape parameters must be greater than zero'
- return uv(rv=ss.exponweib(lamda, k), tag=tag)+ return uv(rv=ss.weibull_min(k, loc=0, scale=lamda), tag=tag)
###############################################################################
I have tested it minimally. Unfortunately it could break existing code but I believe that these changes conform to the principle of least surprise based on your documentation.
The text was updated successfully, but these errors were encountered:
Your
__init__.py
file references the Weibull distribution on line 620 but in reality calls the exponentiated Weibull distribution (exponweib function) from scipy.stats on line 1035. This can be confusing to an unsuspecting user. The attached python script demonstrates the problem.I think that the following patch rectifies the situation.
I have tested it minimally. Unfortunately it could break existing code but I believe that these changes conform to the principle of least surprise based on your documentation.
The text was updated successfully, but these errors were encountered: