Repository: commons-math
Updated Branches:
  refs/heads/MATH_3_X 430c7f456 -> 29dfd9bb6
  refs/heads/master d7362a44f -> 396610625


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/39661062
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/39661062
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/39661062

Branch: refs/heads/master
Commit: 396610625b41f07085c1f43cd6e5e97d69097ba1
Parents: d7362a4
Author: Otmar Ertl <[email protected]>
Authored: Tue Nov 10 21:20:14 2015 +0100
Committer: Otmar Ertl <[email protected]>
Committed: Tue Nov 10 21:20:14 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/commons-math/blob/39661062/src/main/java/org/apache/commons/math4/distribution/ZipfDistribution.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/distribution/ZipfDistribution.java 
b/src/main/java/org/apache/commons/math4/distribution/ZipfDistribution.java
index 7c0d4d8..80da61d 100644
--- a/src/main/java/org/apache/commons/math4/distribution/ZipfDistribution.java
+++ b/src/main/java/org/apache/commons/math4/distribution/ZipfDistribution.java
@@ -25,8 +25,22 @@ import org.apache.commons.math4.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