<p dir="auto">The PDF and CDF functions for the generalized Pareto distribution return nan for any quantile when the shape parameter is zero:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="In [54]: genpareto.pdf([0, 1, 2.5], 0.0)
Out[54]: array([ nan,  nan,  nan])

In [55]: genpareto.cdf([0, 1, 2.5], 0.0)
Out[55]: array([ nan,  nan,  nan])"><pre class="notranslate"><code class="notranslate">In [54]: genpareto.pdf([0, 1, 2.5], 0.0)
Out[54]: array([ nan,  nan,  nan])

In [55]: genpareto.cdf([0, 1, 2.5], 0.0)
Out[55]: array([ nan,  nan,  nan])
</code></pre></div>
<p dir="auto">When the shape is not zero, the standard CDF is <code class="notranslate">1 - (1 + c*z)**(-1/c)</code>, but when the shape is 0, the formula for the standard CDF is <code class="notranslate">1 - exp(-z)</code>.  See the "Definition" section of <a href="http://en.wikipedia.org/wiki/Generalized_Pareto_distribution" rel="nofollow">http://en.wikipedia.org/wiki/Generalized_Pareto_distribution</a>.  The current implementation doesn't handle this special case.</p>
<p dir="auto">The PDF function has the same problem: when the shape is 0, the standard PDF should be <code class="notranslate">exp(-z)</code>.</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/768" rel="nofollow">http://projects.scipy.org/scipy/ticket/768</a> on 2008-10-31 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pbrod/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pbrod">@pbrod</a>, assigned to unknown.</em></p>
<p dir="auto">The generalized pareto cumulative distribution in standard form [1]_ is defined as:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="F(x;c) = 1-(1-c*x)**(1/c) for c&gt;0 and c&lt;0"><pre class="notranslate"><code class="notranslate">F(x;c) = 1-(1-c*x)**(1/c) for c&gt;0 and c&lt;0
</code></pre></div>
<p dir="auto">where c is the shape parameter.</p>
<p dir="auto">The limiting case as c-&gt;0 is the exponential cdf defined as</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="F(x;c=0) = 1-exp(-x)"><pre class="notranslate"><code class="notranslate">F(x;c=0) = 1-exp(-x)
</code></pre></div>
<p dir="auto">and is not implemented in the scipy.stats.distributions.genpareto distribution.</p>
<p dir="auto">To add this limiting case to scipy.stats.distributions.genpareto would<br>
greatly simplify statistical analysis. Through inference on the shape parameter, c,  the data themselves determine the most approprate type of tailbehavior and there is no need for making subjective a priori judgement of which individual extremevalue family to adopt.</p>
<p dir="auto">.. [1] Stuart Coles (2000),<br>
"An Introduction to Statistical Modeling of Extreme Values"</p>