Class AbstractMultivariateRealDistribution
- java.lang.Object
-
- org.apache.commons.math4.legacy.distribution.AbstractMultivariateRealDistribution
-
- All Implemented Interfaces:
MultivariateRealDistribution
- Direct Known Subclasses:
MixtureMultivariateRealDistribution
,MultivariateNormalDistribution
public abstract class AbstractMultivariateRealDistribution extends Object implements MultivariateRealDistribution
Base class for multivariate probability distributions.- Since:
- 3.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.commons.math4.legacy.distribution.MultivariateRealDistribution
MultivariateRealDistribution.Sampler
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMultivariateRealDistribution(int n)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract MultivariateRealDistribution.Sampler
createSampler(org.apache.commons.rng.UniformRandomProvider rng)
Creates a sampler.int
getDimension()
Gets the number of random variables of the distribution.static double[][]
sample(int n, MultivariateRealDistribution.Sampler sampler)
Utility function for creatingn
vectors generated by the givensampler
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.math4.legacy.distribution.MultivariateRealDistribution
density
-
-
-
-
Constructor Detail
-
AbstractMultivariateRealDistribution
protected AbstractMultivariateRealDistribution(int n)
- Parameters:
n
- Number of dimensions.
-
-
Method Detail
-
getDimension
public int getDimension()
Gets the number of random variables of the distribution. It is the size of the array returned by thesample
method.- Specified by:
getDimension
in interfaceMultivariateRealDistribution
- Returns:
- the number of variables.
-
createSampler
public abstract MultivariateRealDistribution.Sampler createSampler(org.apache.commons.rng.UniformRandomProvider rng)
Creates a sampler.- Specified by:
createSampler
in interfaceMultivariateRealDistribution
- Parameters:
rng
- Generator of uniformly distributed numbers.- Returns:
- a sampler that produces random numbers according this distribution.
-
sample
public static double[][] sample(int n, MultivariateRealDistribution.Sampler sampler)
Utility function for creatingn
vectors generated by the givensampler
.- Parameters:
n
- Number of samples.sampler
- Sampler.- Returns:
- an array of size
n
whose elements are random vectors sampled from this distribution.
-
-