类 AbstractIntegerDistribution
java.lang.Object
org.hipparchus.distribution.discrete.AbstractIntegerDistribution
- 所有已实现的接口:
-
Serializable,IntegerDistribution
- 直接已知子类:
-
BinomialDistribution,EnumeratedIntegerDistribution,GeometricDistribution,HypergeometricDistribution,PascalDistribution,PoissonDistribution,UniformIntegerDistribution,ZipfDistribution
public abstract class AbstractIntegerDistribution extends Object implements IntegerDistribution, Serializable
整数值离散分布的基类。
对于一些在分布之间不变的方法,提供了默认实现。
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明intinverseCumulativeProbability(double p) 计算此分布的分位函数。doublelogProbability(int x) 对于随机变量X,其值根据此分布进行分布,此方法返回log(P(X = x)),其中log是自然对数。doubleprobability(int x0, int x1) 对于随机变量X,其值根据此分布进行分布,此方法返回P(x0 < X <= x1)。protected intsolveInverseCumulativeProbability(double p, int lower, int upper) 这是由inverseCumulativeProbability(double)使用的实用函数。从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.hipparchus.distribution.IntegerDistribution
cumulativeProbability, getNumericalMean, getNumericalVariance, getSupportLowerBound, getSupportUpperBound, isSupportConnected, probability
-
构造器详细资料
-
AbstractIntegerDistribution
public AbstractIntegerDistribution()空构造函数。这个构造函数并非绝对必要,但它可以防止在 JDK 18 及更高版本中出现虚假的 javadoc 警告。
- 从以下版本开始:
- 3.0
-
-
方法详细资料
-
probability
对于随机变量X,其值根据此分布进行分布,此方法返回P(x0 < X <= x1)。默认实现使用了恒等式P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)- 指定者:
-
probability在接口中IntegerDistribution - 参数:
-
x0- 排他性下界 -
x1- 包含性上界 - 返回:
-
此分布的随机变量将在
x0和x1之间取值的概率,不包括下界但包括上界 - 抛出:
-
MathIllegalArgumentException- 如果x0 > x1
-
inverseCumulativeProbability
计算此分布的分位函数。对于根据此分布进行分布的随机变量X,返回的值是inf{x in Z | P(X<=x) >= p}对于0 < p <= 1,inf{x in Z | P(X<=x) > 0}对于p = 0。
int的范围,则返回Integer.MIN_VALUE或Integer.MAX_VALUE。默认实现返回IntegerDistribution.getSupportLowerBound()对于p = 0,IntegerDistribution.getSupportUpperBound()对于p = 1,以及solveInverseCumulativeProbability(double, int, int)对于0 < p < 1。
- 指定者:
-
inverseCumulativeProbability在接口中IntegerDistribution - 参数:
-
p- 累积概率 - 返回:
-
此分布的最小
p分位数(p = 0时为最大 0 分位数) - 抛出:
-
MathIllegalArgumentException- 如果p < 0或p > 1
-
solveInverseCumulativeProbability
protected int solveInverseCumulativeProbability(double p, int lower, int upper) 这是由inverseCumulativeProbability(double)使用的实用函数。它假定0 < p < 1并且逆累积概率位于括号(lower, upper]中。该实现使用简单的二分法找到最小的p分位数inf{x in Z | P(X<=x) >= p}。- 参数:
-
p- 累积概率 -
lower- 满足cumulativeProbability(lower) < p的值 -
upper- 满足p <= cumulativeProbability(upper)的值 - 返回:
-
此分布的最小
p分位数
-
logProbability
public double logProbability(int x) 对于根据此分布进行分布的随机变量X,此方法返回log(P(X = x)),其中log是自然对数。换句话说,此方法表示分布的概率质量函数(PMF)的对数。请注意,由于浮点精度和下溢/上溢问题,对于某些分布,此方法比计算IntegerDistribution.probability(int)的对数更精确和更快。默认实现只是计算
probability(x)的对数。- 指定者:
-
logProbability在接口中IntegerDistribution - 参数:
-
x- 评估 PMF 的点 - 返回:
-
概率质量函数在
x处的值的对数
-