public abstract class BaseDistribution extends Object implements Distribution
org.apache.commons.math3.distribution.AbstractRealDistribution| Modifier and Type | Field and Description |
|---|---|
protected Random |
random |
protected double |
solverAbsoluteAccuracy |
| Constructor and Description |
|---|
BaseDistribution() |
BaseDistribution(Random rng) |
| Modifier and Type | Method and Description |
|---|---|
protected double |
getSolverAbsoluteAccuracy()
Returns the solver absolute accuracy for inverse cumulative computation.
|
double |
inverseCumulativeProbability(double p)
Computes the quantile function of this distribution.
|
double |
probability(double x)
For a random variable
X whose values are distributed according
to this distribution, this method returns P(X = x). |
double |
probability(double x0,
double x1)
For a random variable
X whose values are distributed according
to this distribution, this method returns P(x0 < X <= x1). |
void |
reseedRandomGenerator(long seed)
Reseed the random generator used to generate samples.
|
double |
sample()
Generate a random value sampled from this distribution.
|
INDArray |
sample(INDArray target)
Fill the target array by sampling from the distribution
|
double[] |
sample(int sampleSize)
Generate a random sample from the distribution.
|
INDArray |
sample(int[] shape)
Sample the given shape
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcumulativeProbability, cumulativeProbability, density, getNumericalMean, getNumericalVariance, getSupportLowerBound, getSupportUpperBound, isSupportConnected, isSupportLowerBoundInclusive, isSupportUpperBoundInclusiveprotected Random random
protected double solverAbsoluteAccuracy
public BaseDistribution(Random rng)
public BaseDistribution()
public double probability(double x0,
double x1)
X whose values are distributed according
to this distribution, this method returns P(x0 < X <= x1).x0 - Lower bound (excluded).x1 - Upper bound (included).x0 and x1, excluding the lower
and including the upper endpoint.org.apache.commons.math3.exception.NumberIsTooLargeException - if x0 > x1.
The default implementation uses the identity
P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)public double inverseCumulativeProbability(double p)
throws org.apache.commons.math3.exception.OutOfRangeException
X distributed according to this distribution, the
returned value is
inf{x in R | P(X<=x) >= p} for 0 < p <= 1,inf{x in R | P(X<=x) > 0} for p = 0.Distribution.getSupportLowerBound() for p = 0,Distribution.getSupportUpperBound() for p = 1.inverseCumulativeProbability in interface Distributionp - the cumulative probabilityp-quantile of this distribution
(largest 0-quantile for p = 0)org.apache.commons.math3.exception.OutOfRangeException - if p < 0 or p > 1protected double getSolverAbsoluteAccuracy()
public void reseedRandomGenerator(long seed)
reseedRandomGenerator in interface Distributionseed - the new seedpublic double sample()
sample in interface Distributionpublic double[] sample(int sampleSize)
sample() in a loop.sample in interface DistributionsampleSize - the number of random values to generatepublic double probability(double x)
X whose values are distributed according
to this distribution, this method returns P(X = x). In other
words, this method represents the probability mass function (PMF)
for the distribution.probability in interface Distributionx - the point at which the PMF is evaluatedpublic INDArray sample(int[] shape)
Distributionsample in interface Distributionshape - the given shapepublic INDArray sample(INDArray target)
Distributionsample in interface Distributiontarget - target arrayCopyright © 2018. All rights reserved.