MATH-1285: added definition of distribution to javadoc of
ZipfDistribution

Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/29dfd9bb
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/29dfd9bb
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/29dfd9bb

Branch: refs/heads/MATH_3_X
Commit: 29dfd9bb660cbcfb76aabc80458f9452c991bd35
Parents: 430c7f4
Author: Otmar Ertl <[email protected]>
Authored: Tue Nov 10 21:22:42 2015 +0100
Committer: Otmar Ertl <[email protected]>
Committed: Tue Nov 10 21:22:42 2015 +0100

----------------------------------------------------------------------
 .../math3/distribution/ZipfDistribution.java        | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/29dfd9bb/src/main/java/org/apache/commons/math3/distribution/ZipfDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math3/distribution/ZipfDistribution.java 
b/src/main/java/org/apache/commons/math3/distribution/ZipfDistribution.java
index 4538a3a..224aad4 100644
--- a/src/main/java/org/apache/commons/math3/distribution/ZipfDistribution.java
+++ b/src/main/java/org/apache/commons/math3/distribution/ZipfDistribution.java
@@ -25,8 +25,22 @@ import org.apache.commons.math3.util.FastMath;
 
 /**
  * Implementation of the Zipf distribution.
- *
+ * <p>
+ * <strong>Parameters:</strong>
+ * For a random variable {@code X} whose values are distributed according to 
this
+ * distribution, the probability mass function is given by
+ * <pre>
+ *   P(X = k) = H(N,s) * 1 / k^s    for {@code k = 1,2,...,N}.
+ * </pre>
+ * {@code H(N,s)} is the normalizing constant
+ * which corresponds to the generalized harmonic number of order N of s.
+ * <p>
+ * <ul>
+ * <li>{@code N} is the number of elements</li>
+ * <li>{@code s} is the exponent</li>
+ * </ul>
  * @see <a href="https://en.wikipedia.org/wiki/Zipf's_law">Zipf's law 
(Wikipedia)</a>
+ * @see <a 
href="https://en.wikipedia.org/wiki/Harmonic_number#Generalized_harmonic_numbers";>Generalized
 harmonic numbers</a>
  */
 public class ZipfDistribution extends AbstractIntegerDistribution {
     /** Serializable version identifier. */

Reply via email to