[Scipy-svn] r6376 - trunk/scipy/stats

scipy-svn at scipy.org scipy-svn at scipy.org
Sat May 8 04:44:25 EDT 2010


Author: rgommers
Date: 2010-05-08 03:44:25 -0500 (Sat, 08 May 2010)
New Revision: 6376

Modified:
   trunk/scipy/stats/distributions.py
Log:
DOC: Add new-style docstring to nbinom.

Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py	2010-05-08 08:44:09 UTC (rev 6375)
+++ trunk/scipy/stats/distributions.py	2010-05-08 08:44:25 UTC (rev 6376)
@@ -4522,6 +4522,14 @@
 
 # Negative binomial
 class nbinom_gen(rv_discrete):
+    """A negative binomial discrete random variable.
+
+    %(before_pdf)s
+    pmf(x, n, pr, loc=0, scale=1)
+       Probability mass function, given by
+       ``np.choose(k+n-1, n-1) * p**n * (1-p)**k`` for ``k >= 0``.
+    %(after_pdf)s
+    """
     def _rvs(self, n, pr):
         return mtrand.negative_binomial(n, pr, self._size)
     def _argcheck(self, n, pr):
@@ -4549,16 +4557,9 @@
         g1 = (Q+P)/sqrt(n*P*Q)
         g2 = (1.0 + 6*P*Q) / (n*P*Q)
         return mu, var, g1, g2
-nbinom = nbinom_gen(name='nbinom', longname="A negative binomial",
-                    shapes="n, pr", extradoc="""
+nbinom = nbinom_gen(name='nbinom', shapes="n, pr")
 
-Negative binomial distribution
 
-nbinom.pmf(k,n,p) = choose(k+n-1,n-1) * p**n * (1-p)**k
-for k >= 0.
-"""
-                    )
-
 ## Geometric distribution
 
 class geom_gen(rv_discrete):




More information about the Scipy-svn mailing list