AbstractMultivariateRealDistribution (Apache Commons Math 3.6.1 API)

org.apache.commons.math3.distribution

## Class AbstractMultivariateRealDistribution

- java.lang.Object
- - org.apache.commons.math3.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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected RandomGenerator` | `random` RNG instance used to generate samples from the distribution.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractMultivariateRealDistribution(RandomGenerator rng, int n)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getDimension()` Gets the number of random variables of the distribution.
    `void` | `reseedRandomGenerator(long seed)` Reseeds the random generator used to generate samples.
    `abstract double[]` | `sample()` Generates a random value vector sampled from this distribution.
    `double[][]` | `sample(int sampleSize)` Generates a list of a random value vectors from the distribution.

    - ### 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.math3.distribution.MultivariateRealDistribution

      `density`

- - ### Field Detail

    - #### random

          protected final RandomGenerator random

      RNG instance used to generate samples from the distribution.

  - ### Constructor Detail

    - #### AbstractMultivariateRealDistribution

          protected AbstractMultivariateRealDistribution(RandomGenerator rng,
                                              int n)

      Parameters:
        `rng` - Random number generator.
        `n` - Number of dimensions.

  - ### Method Detail

    - #### reseedRandomGenerator

          public void reseedRandomGenerator(long seed)

      Reseeds the random generator used to generate samples.
      Specified by:
        `reseedRandomGenerator` in interface `MultivariateRealDistribution`
      Parameters:
        `seed` - Seed with which to initialize the random number generator.

    - #### getDimension

          public int getDimension()

      Gets the number of random variables of the distribution. It is the size of the array returned by the `sample` method.
      Specified by:
        `getDimension` in interface `MultivariateRealDistribution`
      Returns:
        the number of variables.

    - #### sample

          public abstract double[] sample()

      Generates a random value vector sampled from this distribution.
      Specified by:
        `sample` in interface `MultivariateRealDistribution`
      Returns:
        a random value vector.

    - #### sample

          public double[][] sample(int sampleSize)

      Generates a list of a random value vectors from the distribution.
      Specified by:
        `sample` in interface `MultivariateRealDistribution`
      Parameters:
        `sampleSize` - the number of random vectors to generate.
      Returns:
        an array representing the random samples.
      See Also:
        `MultivariateRealDistribution.sample()`

Copyright © 2003–2016 The Apache Software Foundation. All rights reserved.