jsat.distributions.discrete
Class UniformDiscrete
- java.lang.Object
-
- jsat.distributions.Distribution
-
- jsat.distributions.discrete.DiscreteDistribution
-
- jsat.distributions.discrete.UniformDiscrete
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class UniformDiscrete extends DiscreteDistribution
The discrete uniform distribution.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description UniformDiscrete()Creates a new Uniform distribution with a min of 0 and a max of 10UniformDiscrete(int min, int max)Creates a new discrete uniform distribution
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecdf(int x)Computes the value of the Cumulative Density Function (CDF) at the given point.DiscreteDistributionclone()intgetMax()intgetMin()doubleinvCdf(double p)Computes the inverse Cumulative Density Function (CDF-1) at the given point.doublemax()The maximum value for which the#pdf(double)is meant to return a value.doublemean()Computes the mean value of the distributiondoublemedian()Computes the median value of the distributiondoublemin()The minimum value for which the#pdf(double)is meant to return a value.doublemode()Computes the mode of the distribution.doublepmf(int x)voidsetMax(int max)Sets the maximum value to occur from the distribution, must be greater thangetMin().voidsetMin(int min)Sets the minimum value to occur from the distribution, must be less thangetMax().voidsetMinMax(int min, int max)Sets the minimum and maximum values at the same time, this is useful if setting them one at a time may have caused a conflict with the previous valuesdoubleskewness()Computes the skewness of the distribution.doublevariance()Computes the variance of the distribution.-
Methods inherited from class jsat.distributions.discrete.DiscreteDistribution
cdf, logPmf
-
Methods inherited from class jsat.distributions.Distribution
sample, sampleVec, standardDeviation
-
-
-
-
Constructor Detail
-
UniformDiscrete
public UniformDiscrete()
Creates a new Uniform distribution with a min of 0 and a max of 10
-
UniformDiscrete
public UniformDiscrete(int min, int max)Creates a new discrete uniform distribution- Parameters:
min- the minimum value to occurmax- the maximum value to occur
-
-
Method Detail
-
setMinMax
public void setMinMax(int min, int max)Sets the minimum and maximum values at the same time, this is useful if setting them one at a time may have caused a conflict with the previous values- Parameters:
min- the new minimum value to occurmax- the new maximum value to occur
-
setMin
public void setMin(int min)
Sets the minimum value to occur from the distribution, must be less thangetMax().- Parameters:
min- the minimum value to occur
-
getMin
public int getMin()
-
setMax
public void setMax(int max)
Sets the maximum value to occur from the distribution, must be greater thangetMin().- Parameters:
max- the maximum value to occur
-
getMax
public int getMax()
-
pmf
public double pmf(int x)
- Specified by:
pmfin classDiscreteDistribution
-
cdf
public double cdf(int x)
Description copied from class:DiscreteDistributionComputes the value of the Cumulative Density Function (CDF) at the given point. The CDF returns a value in the range [0, 1], indicating what portion of values occur at or below that point.- Specified by:
cdfin classDiscreteDistribution- Parameters:
x- the value to get the CDF of- Returns:
- the CDF(x)
-
invCdf
public double invCdf(double p)
Description copied from class:DistributionComputes the inverse Cumulative Density Function (CDF-1) at the given point. It takes in a value in the range of [0, 1] and returns the value x, such that CDF(x) = p- Overrides:
invCdfin classDiscreteDistribution- Parameters:
p- the probability value- Returns:
- the value such that the CDF would return p
-
mean
public double mean()
Description copied from class:DistributionComputes the mean value of the distribution- Specified by:
meanin classDistribution- Returns:
- the mean value of the distribution
-
median
public double median()
Description copied from class:DistributionComputes the median value of the distribution- Overrides:
medianin classDistribution- Returns:
- the median value of the distribution
-
mode
public double mode()
Description copied from class:DistributionComputes the mode of the distribution. Not all distributions have a mode for all parameter values.NaNmay be returned if the mode is not defined for the current values of the distribution.- Specified by:
modein classDistribution- Returns:
- the mode of the distribution
-
variance
public double variance()
Description copied from class:DistributionComputes the variance of the distribution. Not all distributions have a finite variance for all parameter values.NaNmay be returned if the variance is not defined for the current values of the distribution.Infinityis a possible value to be returned by some distributions.- Specified by:
variancein classDistribution- Returns:
- the variance of the distribution.
-
skewness
public double skewness()
Description copied from class:DistributionComputes the skewness of the distribution. Not all distributions have a finite skewness for all parameter values.NaNmay be returned if the skewness is not defined for the current values of the distribution.- Specified by:
skewnessin classDistribution- Returns:
- the skewness of the distribution.
-
min
public double min()
Description copied from class:DistributionThe minimum value for which the#pdf(double)is meant to return a value. Note thatDouble.NEGATIVE_INFINITYis a valid return value.- Specified by:
minin classDistribution- Returns:
- the minimum value for which the
#pdf(double)is meant to return a value.
-
max
public double max()
Description copied from class:DistributionThe maximum value for which the#pdf(double)is meant to return a value. Note thatDouble.POSITIVE_INFINITYis a valid return value.- Specified by:
maxin classDistribution- Returns:
- the maximum value for which the
#pdf(double)is meant to return a value.
-
clone
public DiscreteDistribution clone()
- Specified by:
clonein classDiscreteDistribution
-
-
DataMelt 3.0 © DataMelt by jWork.ORG