You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2022/11/12 16:52:34 UTC

[commons-statistics] 02/02: Triangular distribution documentation update

This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit 956fe8291be392d0bcd67f7bbef40fda0a67cc19
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sat Nov 12 16:51:42 2022 +0000

    Triangular distribution documentation update
    
    Switch mean/var function documentation to MathJax.
    
    Remove duplication of PDF definition.
    
    Remove CDF definition.
---
 .../distribution/TriangularDistribution.java       | 31 +++-------------------
 1 file changed, 4 insertions(+), 27 deletions(-)

diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TriangularDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TriangularDistribution.java
index aa45825..4f65543 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TriangularDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TriangularDistribution.java
@@ -104,18 +104,7 @@ public final class TriangularDistribution extends AbstractContinuousDistribution
         return c;
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * <p>For lower limit {@code a}, upper limit {@code b} and mode {@code c}, the
-     * PDF is given by
-     * <ul>
-     * <li>{@code 2 * (x - a) / [(b - a) * (c - a)]} if {@code a <= x < c},</li>
-     * <li>{@code 2 / (b - a)} if {@code x = c},</li>
-     * <li>{@code 2 * (b - x) / [(b - a) * (b - c)]} if {@code c < x <= b},</li>
-     * <li>{@code 0} otherwise.
-     * </ul>
-     */
+    /** {@inheritDoc} */
     @Override
     public double density(double x) {
         if (x < a) {
@@ -135,19 +124,7 @@ public final class TriangularDistribution extends AbstractContinuousDistribution
         return 0;
     }
 
-    /**
-     * {@inheritDoc}
-     *
-     * <p>For lower limit {@code a}, upper limit {@code b} and mode {@code c}, the
-     * CDF is given by
-     * <ul>
-     * <li>{@code 0} if {@code x < a},</li>
-     * <li>{@code (x - a)^2 / [(b - a) * (c - a)]} if {@code a <= x < c},</li>
-     * <li>{@code (c - a) / (b - a)} if {@code x = c},</li>
-     * <li>{@code 1 - (b - x)^2 / [(b - a) * (b - c)]} if {@code c < x <= b},</li>
-     * <li>{@code 1} if {@code x > b}.</li>
-     * </ul>
-     */
+    /** {@inheritDoc} */
     @Override
     public double cumulativeProbability(double x)  {
         if (x <= a) {
@@ -226,7 +203,7 @@ public final class TriangularDistribution extends AbstractContinuousDistribution
      * {@inheritDoc}
      *
      * <p>For lower limit {@code a}, upper limit {@code b}, and mode {@code c},
-     * the mean is {@code (a + b + c) / 3}.
+     * the mean is \( (a + b + c) / 3 \).
      */
     @Override
     public double getMean() {
@@ -237,7 +214,7 @@ public final class TriangularDistribution extends AbstractContinuousDistribution
      * {@inheritDoc}
      *
      * <p>For lower limit {@code a}, upper limit {@code b}, and mode {@code c},
-     * the variance is {@code (a^2 + b^2 + c^2 - a * b - a * c - b * c) / 18}.
+     * the variance is \( (a^2 + b^2 + c^2 - ab - ac - bc) / 18 \).
      */
     @Override
     public double getVariance() {