Catalano.Statistics.Distributions
Class DiscreteUniformDistribution
- java.lang.Object
-
- Catalano.Statistics.Distributions.DiscreteUniformDistribution
-
- All Implemented Interfaces:
- IDiscreteDistribution
public class DiscreteUniformDistribution extends java.lang.Object implements IDiscreteDistribution
Discrete uniform distribution.
-
-
Constructor Summary
Constructors Constructor and Description DiscreteUniformDistribution(int a, int b)Initializes a new instance of the DiscreteUniformDistribution class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleDistributionFunction(int k)Gets the cumulative distribution function (cdf) for this distribution evaluated at pointk .doubleEntropy()Gets the entropy for this distribution.doublegetLength()Gets the length of the distribution (b - a + 1).doublegetMaximum()Gets the maximum value of the distribution (b).doublegetMinimum()Gets the minimum value of the distribution (a).doubleLogProbabilityMassFunction(int k)Gets the log-probability mass function (pmf) for this distribution evaluated at pointx .doubleMean()Gets the mean for this distribution.doubleProbabilityMassFunction(int k)Gets the probability mass function (pmf) for this distribution evaluated at pointx .doubleVariance()Gets the variance for this distribution.
-
-
-
Constructor Detail
-
DiscreteUniformDistribution
public DiscreteUniformDistribution(int a, int b)Initializes a new instance of the DiscreteUniformDistribution class.- Parameters:
a- The starting (minimum) value a.b- The ending (maximum) value b.
-
-
Method Detail
-
getMinimum
public double getMinimum()
Gets the minimum value of the distribution (a).- Returns:
- Minimum value.
-
getMaximum
public double getMaximum()
Gets the maximum value of the distribution (b).- Returns:
- Maximum value.
-
getLength
public double getLength()
Gets the length of the distribution (b - a + 1).- Returns:
- Length.
-
Mean
public double Mean()
Description copied from interface:IDiscreteDistributionGets the mean for this distribution.- Specified by:
Meanin interfaceIDiscreteDistribution- Returns:
- Mean.
-
Variance
public double Variance()
Description copied from interface:IDiscreteDistributionGets the variance for this distribution.- Specified by:
Variancein interfaceIDiscreteDistribution- Returns:
- Variance.
-
Entropy
public double Entropy()
Description copied from interface:IDiscreteDistributionGets the entropy for this distribution.- Specified by:
Entropyin interfaceIDiscreteDistribution- Returns:
- Entropy.
-
DistributionFunction
public double DistributionFunction(int k)
Description copied from interface:IDiscreteDistributionGets the cumulative distribution function (cdf) for this distribution evaluated at pointk .The Cumulative Distribution Function (CDF) describes the cumulative probability that a given value or any value smaller than it will occur. - Specified by:
DistributionFunctionin interfaceIDiscreteDistribution- Parameters:
k- A single point in the distribution range.- Returns:
- Result.
-
ProbabilityMassFunction
public double ProbabilityMassFunction(int k)
Description copied from interface:IDiscreteDistributionGets the probability mass function (pmf) for this distribution evaluated at pointx .The Probability Mass Function (PMF) describes the probability that a given value k will occur.- Specified by:
ProbabilityMassFunctionin interfaceIDiscreteDistribution- Parameters:
k- A single point in the distribution range.- Returns:
- The probability of
k occurring in the current distribution.
-
LogProbabilityMassFunction
public double LogProbabilityMassFunction(int k)
Description copied from interface:IDiscreteDistributionGets the log-probability mass function (pmf) for this distribution evaluated at pointx .The Probability Mass Function (PMF) describes the probability that a given value k will occur.- Specified by:
LogProbabilityMassFunctionin interfaceIDiscreteDistribution- Parameters:
k- A single point in the distribution range.- Returns:
- The logarithm of the probability of
k occurring in the current distribution.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG