You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2014/05/24 23:22:00 UTC

svn commit: r1597357 - /commons/proper/math/trunk/src/site/xdoc/userguide/distribution.xml

Author: psteitz
Date: Sat May 24 21:21:59 2014
New Revision: 1597357

URL: http://svn.apache.org/r1597357
Log:
Added some info on sampling.

Modified:
    commons/proper/math/trunk/src/site/xdoc/userguide/distribution.xml

Modified: commons/proper/math/trunk/src/site/xdoc/userguide/distribution.xml
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/site/xdoc/userguide/distribution.xml?rev=1597357&r1=1597356&r2=1597357&view=diff
==============================================================================
--- commons/proper/math/trunk/src/site/xdoc/userguide/distribution.xml (original)
+++ commons/proper/math/trunk/src/site/xdoc/userguide/distribution.xml Sat May 24 21:21:59 2014
@@ -28,7 +28,16 @@
       <subsection name="8.1 Overview" href="overview">
         <p>
           The distributions package provides a framework and implementations for some commonly used
-          probability distributions.
+          probability distributions. Continuous univariate distributions are represented by implementations of
+          the <a href="../apidocs/org/apache/commons/math3/distribution/RealDistribution.html">RealDistribution</a>
+          interface.  Discrete distributions implement
+          <a href="../apidocs/org/apache/commons/math3/distribution/IntegerDistribution.html">IntegerDistribution</a>
+          (values must be mapped to integers) and there is an
+          <a href="../apidocs/org/apache/commons/math3/distribution/EnumeratedDistribution.html">EnumeratedDistribution</a>
+          class representing discrete distributions with a finite, enumerated set of values.  Finally, multivariate
+          real-valued distributions can be represented via the 
+          <a href="../apidocs/org/apache/commons/math3/distribution/MultiVariateRealDistribution.html">MultivariateRealDistribution</a>
+          interface.
         </p>
         <p>
           An overview of available continuous distributions:<br/>
@@ -42,7 +51,8 @@
           (<code>probability(&middot;)</code>) and distribution functions
           (<code>cumulativeProbability(&middot;)</code>) for both
           discrete (integer-valued) and continuous probability distributions.
-          The framework also allows for the computation of inverse cumulative probabilities.
+          The framework also allows for the computation of inverse cumulative probabilities
+          and sampling from distributions.
         </p>
         <p>
           For an instance <code>f</code> of a distribution <code>F</code>,
@@ -63,6 +73,14 @@
 double lowerTail = t.cumulativeProbability(-2.656);     // P(T(29) &lt;= -2.656)
 double upperTail = 1.0 - t.cumulativeProbability(2.75); // P(T(29) &gt;= 2.75)</source>
         <p>
+          All distributions implement a <code>sample()</code> method to support random sampling from the
+          distribution. Implementation classes expose constructors allowing the default 
+          <a href="../apidocs/org/apache/commons/math3/random/RandomGenerator.html">RandomGenerator</a>
+          used by the sampling algorithm to be overridden.  If sampling is not going to be used, providing
+          a null <code>RandomGenerator</code> constructor argument will avoid the overhead of initializing
+          the default generator.
+        </p>
+        <p>
           Inverse distribution functions can be computed using the
           <code>inverseCumulativeProbability</code> methods.  For continuous <code>f</code>
           and <code>p</code> a probability, <code>f.inverseCumulativeProbability(p)</code> returns