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:32 UTC
[commons-statistics] branch master updated (3dc9499 -> 956fe82)
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git
from 3dc9499 Test comments
new 3ee52f7 Statistics-25: Remove T-dist switch to normal CDF
new 956fe82 Triangular distribution documentation update
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../statistics/distribution/TDistribution.java | 10 -------
.../distribution/TriangularDistribution.java | 31 +++-------------------
2 files changed, 4 insertions(+), 37 deletions(-)
[commons-statistics] 02/02: Triangular distribution documentation update
Posted by ah...@apache.org.
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() {
[commons-statistics] 01/02: Statistics-25: Remove T-dist switch to normal CDF
Posted by ah...@apache.org.
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 3ee52f7ca0883495e0df1ca2a914ad24b5ba968a
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sat Nov 12 16:46:15 2022 +0000
Statistics-25: Remove T-dist switch to normal CDF
---
.../apache/commons/statistics/distribution/TDistribution.java | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java
index e828276..898b414 100644
--- a/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java
+++ b/commons-statistics-distribution/src/main/java/org/apache/commons/statistics/distribution/TDistribution.java
@@ -110,10 +110,6 @@ public abstract class TDistribution extends AbstractContinuousDistribution {
private static class StudentsTDistribution extends TDistribution {
/** 2. */
private static final double TWO = 2;
- /** Number of degrees of freedom above which to use the normal distribution.
- * This is used to check the CDF when the degrees of freedom is large.
- * Set to 1 / machine epsilon, 2^52, or 4.50e15. */
- private static final double DOF_THRESHOLD_NORMAL = 0x1.0p52;
/** The threshold for the density function where the
* power function base minus 1 is close to zero. */
private static final double CLOSE_TO_ZERO = 0.25;
@@ -185,12 +181,6 @@ public abstract class TDistribution extends AbstractContinuousDistribution {
}
final double v = getDegreesOfFreedom();
- // This threshold may no longer be required.
- // See STATISTICS-25.
- if (v > DOF_THRESHOLD_NORMAL) {
- return STANDARD_NORMAL.cumulativeProbability(x);
- }
-
// cdf(t) = 1 - 0.5 * I_x(t)(v/2, 1/2)
// where x(t) = v / (v + t^2)
//