public class UniformIntDist extends DiscreteDistributionInt
DiscreteDistributionInt for
the discrete uniform distribution over the range [i, j].
Its mass function is given by
EPSILON| Constructor and Description |
|---|
UniformIntDist(int i,
int j)
Constructs a discrete uniform distribution over the interval [i, j].
|
| Modifier and Type | Method and Description |
|---|---|
double |
barF(int x)
Returns bar(F)(x), the complementary
distribution function.
|
static double |
barF(int i,
int j,
int x)
Computes the discrete uniform complementary distribution function
bar(F)(x).
|
double |
cdf(int x)
Returns the distribution function F evaluated at x
(see).
|
static double |
cdf(int i,
int j,
int x)
Computes the discrete uniform distribution function
defined in.
|
int |
getI()
Returns the parameter i.
|
static UniformIntDist |
getInstanceFromMLE(int[] x,
int n)
Creates a new instance of a discrete uniform distribution over integers with parameters
i and j estimated using the maximum likelihood method based on the n observations
x[k],
k = 0, 1,…, n - 1.
|
int |
getJ()
Returns the parameter j.
|
static double[] |
getMaximumLikelihoodEstimate(int[] x,
int n)
Deprecated.
|
double |
getMean()
Returns the mean of the distribution function.
|
static double |
getMean(int i,
int j)
Computes and returns the mean
E[X] = (i + j)/2
of the discrete uniform distribution.
|
static double[] |
getMLE(int[] x,
int n)
Estimates the parameters (i, j) of the uniform distribution
over integers using the maximum likelihood method, from the n observations
x[k],
k = 0, 1,…, n - 1.
|
double[] |
getParams()
Return a table containing the parameters of the current distribution.
|
double |
getStandardDeviation()
Returns the standard deviation of the distribution function.
|
static double |
getStandardDeviation(int i,
int j)
Computes and returns the standard deviation
of the discrete uniform distribution.
|
double |
getVariance()
Returns the variance of the distribution function.
|
static double |
getVariance(int i,
int j)
Computes and returns the variance
Var[X] = [(j - i + 1)2 -1]/12
of the discrete uniform distribution.
|
static int |
inverseF(int i,
int j,
double u)
Computes the inverse of the discrete uniform distribution function.
|
int |
inverseFInt(double u)
Returns the inverse distribution function
F-1(u), where
0 <= u <= 1.
|
double |
prob(int x)
Returns p(x), the probability of x,
which should be a real number in the interval [0, 1].
|
static double |
prob(int i,
int j,
int x)
Computes the discrete uniform probability p(x).
|
void |
setParams(int i,
int j)
Sets the parameters i and j for this object.
|
java.lang.String |
toString() |
public UniformIntDist(int i,
int j)
public double prob(int x)
DiscreteDistributionIntprob in class DiscreteDistributionIntx - value at which the mass function must be evaluatedpublic double cdf(int x)
DiscreteDistributionIntcdf in class DiscreteDistributionIntx - value at which the distribution function must be evaluatedpublic double barF(int x)
DiscreteDistributionIntbarF in class DiscreteDistributionIntx - value at which the complementary distribution function
must be evaluatedpublic int inverseFInt(double u)
DiscreteDistributionIntinverseFInt in class DiscreteDistributionIntu - value in the interval (0, 1) for which
the inverse distribution function is evaluatedpublic double getMean()
Distributionpublic double getVariance()
Distributionpublic double getStandardDeviation()
Distributionpublic static double prob(int i,
int j,
int x)
public static double cdf(int i,
int j,
int x)
public static double barF(int i,
int j,
int x)
public static int inverseF(int i,
int j,
double u)
public static double[] getMLE(int[] x,
int n)
x - the list of observations used to evaluate parametersn - the number of observations used to evaluate parameters@Deprecated
public static double[] getMaximumLikelihoodEstimate(int[] x,
int n)
getMLE.public static UniformIntDist getInstanceFromMLE(int[] x, int n)
x - the list of observations to use to evaluate parametersn - the number of observations to use to evaluate parameterspublic static double getMean(int i,
int j)
public static double getVariance(int i,
int j)
public static double getStandardDeviation(int i,
int j)
public int getI()
public int getJ()
public void setParams(int i,
int j)
public double[] getParams()
public java.lang.String toString()
toString in class java.lang.ObjectTo submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.