[Scipy-tickets] [SciPy] #770: cdf, pdf formulas of general exponential are wrong
SciPy
scipy-tickets@scipy....
Sun Nov 2 09:17:30 CST 2008
#770: cdf, pdf formulas of general exponential are wrong
-------------------------+--------------------------------------------------
Reporter: josefpktd | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 0.7.0
Component: scipy.stats | Version:
Severity: normal | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Comment (by konrad):
The formulae in the nist gexcdf.pdf are incorrect. The equations for Ryu's
generalised exponential distribution are given in
http://tinyurl.com/5wk2gz
There is a minus sign missing in the equations for both the pdf and the
cdf.
Incorrect equations in current version:
{{{
class genexpon_gen(rv_continuous):
def _pdf(self, x, a, b, c):
return (a+b*(1-exp(-c*x)))*exp((a-b)*x+b*(1-exp(-c*x))/c)
def _cdf(self, x, a, b, c):
return 1.0-exp((a-b)*x + b*(1-exp(-c*x))/c)
}}}
Correct equations (diff file attached):
{{{
class genexpon_gen(rv_continuous):
def _pdf(self, x, a, b, c):
return (a+b*(1-exp(-c*x)))*exp((-a-b)*x+b*(1-exp(-c*x))/c)
def _cdf(self, x, a, b, c):
return 1.0-exp((-a-b)*x + b*(1-exp(-c*x))/c)
}}}
I have also added a test to check if the pdf integrates to 1 and that the
cdf is bounded between 0 and 1.
--
Ticket URL: <http://scipy.org/scipy/scipy/ticket/770#comment:1>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list