|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.distribution.AbstractMultivariateRealDistribution
org.apache.commons.math3.distribution.MixtureMultivariateRealDistribution<T>
T
- Type of the mixture components.public class MixtureMultivariateRealDistribution<T extends MultivariateRealDistribution>
Class for representing mixture model distributions.
Field Summary |
---|
Fields inherited from class org.apache.commons.math3.distribution.AbstractMultivariateRealDistribution |
---|
random |
Constructor Summary | |
---|---|
MixtureMultivariateRealDistribution(List<Pair<Double,T>> components)
Creates a mixture model from a list of distributions and their associated weights. |
|
MixtureMultivariateRealDistribution(RandomGenerator rng,
List<Pair<Double,T>> components)
Creates a mixture model from a list of distributions and their associated weights. |
Method Summary | |
---|---|
double |
density(double[] values)
Returns the probability density function (PDF) of this distribution evaluated at the specified point x . |
List<Pair<Double,T>> |
getComponents()
Gets the distributions that make up the mixture model. |
void |
reseedRandomGenerator(long seed)
Reseeds the random generator used to generate samples. |
double[] |
sample()
Generates a random value vector sampled from this distribution. |
Methods inherited from class org.apache.commons.math3.distribution.AbstractMultivariateRealDistribution |
---|
getDimension, sample |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MixtureMultivariateRealDistribution(List<Pair<Double,T>> components)
components
- List of (weight, distribution) pairs from which to sample.public MixtureMultivariateRealDistribution(RandomGenerator rng, List<Pair<Double,T>> components)
rng
- Random number generator.components
- Distributions from which to sample.
NotPositiveException
- if any of the weights is negative.
DimensionMismatchException
- if not all components have the same
number of variables.Method Detail |
---|
public double density(double[] values)
x
. In general, the PDF is the
derivative of the cumulative distribution function. If the derivative
does not exist at x
, then an appropriate replacement should be
returned, e.g. Double.POSITIVE_INFINITY
, Double.NaN
, or
the limit inferior or limit superior of the difference quotient.
values
- Point at which the PDF is evaluated.
x
.public double[] sample()
sample
in interface MultivariateRealDistribution
sample
in class AbstractMultivariateRealDistribution
public void reseedRandomGenerator(long seed)
reseedRandomGenerator
in interface MultivariateRealDistribution
reseedRandomGenerator
in class AbstractMultivariateRealDistribution
seed
- Seed with which to initialize the random number generator.public List<Pair<Double,T>> getComponents()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |