public abstract class DiscreteDistribution extends AbstractDistribution
| Constructor and Description |
|---|
DiscreteDistribution() |
| Modifier and Type | Method and Description |
|---|---|
double |
likelihood(int[] x)
The likelihood given a sample set following the distribution.
|
double |
logLikelihood(int[] x)
The likelihood given a sample set following the distribution.
|
double |
logp(double x)
The density at x in log scale, which may prevents the underflow problem.
|
abstract double |
logp(int x)
The probability mass function in log scale.
|
double |
p(double x)
The probability density function for continuous distribution
or probability mass function for discrete distribution at x.
|
abstract double |
p(int x)
The probability mass function.
|
protected double |
quantile(double p,
int xmin,
int xmax)
Invertion of cdf by bisection numeric root finding of
cdf(x) = p for discrete distribution. |
int |
randi()
Generates an integer random numbers following this discrete distribution.
|
int[] |
randi(int n)
Generates a set of integer random numbers following this discrete distribution.
|
inverseTransformSampling, quantile, quantile, rejectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcdf, entropy, length, likelihood, logLikelihood, mean, quantile, rand, rand, sd, variancepublic int randi()
public int[] randi(int n)
public abstract double p(int x)
public double p(double x)
Distributionpublic abstract double logp(int x)
public double logp(double x)
Distributionpublic double likelihood(int[] x)
public double logLikelihood(int[] x)
protected double quantile(double p,
int xmin,
int xmax)
cdf(x) = p for discrete distribution.n such that
P(<n) ≤ p ≤ P(<n+1).