[Scipy-svn] r6375 - trunk/scipy/stats
scipy-svn at scipy.org
scipy-svn at scipy.org
Sat May 8 04:44:10 EDT 2010
Author: rgommers
Date: 2010-05-08 03:44:09 -0500 (Sat, 08 May 2010)
New Revision: 6375
Modified:
trunk/scipy/stats/distributions.py
Log:
DOC: Add Maxwell distribution docstring with extra info.
Modified: trunk/scipy/stats/distributions.py
===================================================================
--- trunk/scipy/stats/distributions.py 2010-05-08 08:43:55 UTC (rev 6374)
+++ trunk/scipy/stats/distributions.py 2010-05-08 08:44:09 UTC (rev 6375)
@@ -187,6 +187,8 @@
_doc_default_callparams,
_doc_default_frozen_note,
_doc_default_example])
+_doc_methods_after_pdf = ''.join([_doc_cdf, _doc_sf, _doc_ppf, _doc_isf,
+ _doc_stats, _doc_entropy, _doc_fit])
docdict = {'rvs':_doc_rvs,
'pdf':_doc_pdf,
'cdf':_doc_cdf,
@@ -203,7 +205,8 @@
'example':_doc_default_example,
'default':_doc_default,
'before_pdf':_doc_default_before_pdf,
- 'after_pdf':_doc_default_after_pdf}
+ 'after_pdf':_doc_default_after_pdf,
+ 'afterpdf_methods':_doc_methods_after_pdf}
# Reuse common content between continous and discrete docs, change some minor
# bits.
@@ -2829,10 +2832,32 @@
# MAXWELL
-# a special case of chi with df = 3, loc=0.0, and given scale = 1.0/sqrt(a)
-# where a is the parameter used in mathworld description
class maxwell_gen(rv_continuous):
+ """A Maxwell continuous random variable.
+
+ Methods
+ -------
+ %(rvs)s
+ pdf(x, loc=0, scale=1)
+ Probability density function. Given by
+ :math:`\sqrt(2/\pi)x^2 exp(-x^2/2)` for ``x > 0``.
+ %(afterpdf_methods)s
+ %(callparams)s
+ %(frozennote)s
+
+ Notes
+ -----
+ A special case of a `chi` distribution, with ``df = 3``, ``loc = 0.0``,
+ and given ``scale = 1.0 / sqrt(a)``, where a is the parameter used in
+ the Mathworld description [1]_.
+
+ References
+ ----------
+ .. [1] http://mathworld.wolfram.com/MaxwellDistribution.html
+
+ %(example)s
+ """
def _rvs(self):
return chi.rvs(3.0,size=self._size)
def _pdf(self, x):
@@ -2847,16 +2872,9 @@
(-12*pi*pi + 160*pi - 384) / val**2.0
def _entropy(self):
return _EULER + 0.5*log(2*pi)-0.5
-maxwell = maxwell_gen(a=0.0, name='maxwell', longname="A Maxwell",
- extradoc="""
+maxwell = maxwell_gen(a=0.0, name='maxwell')
-Maxwell distribution
-maxwell.pdf(x) = sqrt(2/pi) * x**2 * exp(-x**2/2)
-for x > 0.
-"""
- )
-
# Mielke's Beta-Kappa
class mielke_gen(rv_continuous):
More information about the Scipy-svn
mailing list