public abstract class AbstractClosedFormSmoothUnivariateDistribution extends AbstractClosedFormUnivariateDistribution<java.lang.Double> implements SmoothUnivariateDistribution
Constructor and Description |
---|
AbstractClosedFormSmoothUnivariateDistribution() |
Modifier and Type | Method and Description |
---|---|
java.lang.Double |
getMean()
Gets the arithmetic mean, or "first central moment" or "expectation",
of the distribution.
|
double |
sampleAsDouble(java.util.Random random)
Samples a value from this distribution as a double.
|
double[] |
sampleAsDoubles(java.util.Random random,
int count)
Samples values from this distribution as an array of doubles.
|
void |
sampleInto(java.util.Random random,
int sampleCount,
java.util.Collection<? super java.lang.Double> output)
Draws multiple random samples from the distribution and puts the result
into the given collection.
|
clone
sample, sample
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCDF, getProbabilityFunction, sampleInto
getMaxSupport, getMeanAsDouble, getMinSupport, getVariance
sample, sample
clone, convertFromVector, convertToVector
public AbstractClosedFormSmoothUnivariateDistribution()
public java.lang.Double getMean()
DistributionWithMean
getMean
in interface DistributionWithMean<java.lang.Double>
getMean
in interface SmoothUnivariateDistribution
public double sampleAsDouble(java.util.Random random)
SmoothUnivariateDistribution
sampleAsDouble
in interface SmoothUnivariateDistribution
random
- Random number generator to use.public double[] sampleAsDoubles(java.util.Random random, int count)
SmoothUnivariateDistribution
sampleAsDoubles
in interface SmoothUnivariateDistribution
random
- Random number generator to use.count
- The number of values to sample. Cannot be negativepublic void sampleInto(java.util.Random random, int sampleCount, java.util.Collection<? super java.lang.Double> output)
Distribution
sampleInto
in interface Distribution<java.lang.Double>
random
- Random number generator to use.sampleCount
- The number of samples to draw. Cannot be negative.output
- The collection to add the samples into.