public class UniformDiscrete extends DiscreteDistribution
Constructor and Description |
---|
UniformDiscrete()
Creates a new Uniform distribution with a min of 0 and a max of 10
|
UniformDiscrete(int min,
int max)
Creates a new discrete uniform distribution
|
Modifier and Type | Method and Description |
---|---|
double |
cdf(int x)
Computes the value of the Cumulative Density Function (CDF) at the given point.
|
DiscreteDistribution |
clone() |
int |
getMax() |
int |
getMin() |
double |
invCdf(double p)
Computes the inverse Cumulative Density Function (CDF-1) at
the given point.
|
double |
max()
The maximum value for which the
#pdf(double) is meant to return
a value. |
double |
mean()
Computes the mean value of the distribution
|
double |
median()
Computes the median value of the distribution
|
double |
min()
The minimum value for which the
#pdf(double) is meant to return
a value. |
double |
mode()
Computes the mode of the distribution.
|
double |
pmf(int x) |
void |
setMax(int max)
Sets the maximum value to occur from the distribution, must be greater
than
getMin() . |
void |
setMin(int min)
Sets the minimum value to occur from the distribution, must be less than
getMax() . |
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
|
double |
skewness()
Computes the skewness of the distribution.
|
double |
variance()
Computes the variance of the distribution.
|
cdf, invCdf, logPmf
getFunctionCDF, sample, sampleVec, standardDeviation
public UniformDiscrete()
public UniformDiscrete(int min, int max)
min
- the minimum value to occurmax
- the maximum value to occurpublic void setMinMax(int min, int max)
min
- the new minimum value to occurmax
- the new maximum value to occurpublic void setMin(int min)
getMax()
.min
- the minimum value to occurpublic int getMin()
public void setMax(int max)
getMin()
.max
- the maximum value to occurpublic int getMax()
public double pmf(int x)
pmf
in class DiscreteDistribution
public double cdf(int x)
DiscreteDistribution
cdf
in class DiscreteDistribution
x
- the value to get the CDF ofpublic double invCdf(double p)
Distribution
invCdf
in class DiscreteDistribution
p
- the probability valuepublic double mean()
Distribution
mean
in class Distribution
public double median()
Distribution
median
in class Distribution
public double mode()
Distribution
NaN
may be returned if the mode is not defined for the current values of the
distribution.mode
in class Distribution
public double variance()
Distribution
NaN
may be
returned if the variance is not defined for the current values of the distribution.
Infinity
is a possible value to be returned
by some distributions.variance
in class Distribution
public double skewness()
Distribution
NaN
may be
returned if the skewness is not defined for the current values of the distribution.skewness
in class Distribution
public double min()
Distribution
#pdf(double)
is meant to return
a value. Note that Double.NEGATIVE_INFINITY
is a valid return
value.min
in class Distribution
#pdf(double)
is meant to
return a value.public double max()
Distribution
#pdf(double)
is meant to return
a value. Note that Double.POSITIVE_INFINITY
is a valid return
value.max
in class Distribution
#pdf(double)
is meant to
return a value.public DiscreteDistribution clone()
clone
in class DiscreteDistribution
Copyright © 2017. All rights reserved.