Documentation of 'umontreal.iro.lecuyer.randvarmulti.MultinormalGen' Java class
MultinormalGen
umontreal.iro.lecuyer.randvarmulti

Class MultinormalGen

  • Direct Known Subclasses:
    MultinormalCholeskyGen, MultinormalPCAGen


    public class MultinormalGen
    extends RandomMultivariateGen
    Extends RandomMultivariateGen for a multivariate normal (or multinormal) distribution. The d-dimensional multivariate normal distribution with mean vector μRd and (symmetric positive-definite) covariance matrix Σ, denoted N(μ, Σ), has density

    f (X) = exp(- (X - μ)tΣ-1(X - μ)/2)/((2π)^d  )1/2,

    for all XRd, and Xt is the transpose vector of X. If ZN( 0,I) where I is the identity matrix, Z is said to have the standard multinormal distribution.

    For the special case d = 2, if the random vector X = (X1, X2)t has a bivariate normal distribution, then it has mean μ = (μ1, μ2)t, and covariance matrix

    Σ = [$\displaystyle \begin{array}{cc}
 \sigma_1^2 & \rho\sigma_1\sigma_2 \\
 \rho\sigma_1\sigma_2 &\sigma_2^2
 \end{array}$]

    if and only if Var[X1] = σ12, Var[X2] = σ22, and the linear correlation between X1 and X2 is ρ, where σ1 > 0, σ2 > 0, and -1 <= ρ <= 1.
    • Constructor Summary

      Constructors 
      Constructor and Description
      MultinormalGen(NormalGen gen1, int d)
      Constructs a generator with the standard multinormal distribution (with μ = 0 and Σ = I) in d dimensions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double[] getMu()
      Returns the mean vector used by this generator.
      double getMu(int i)
      Returns the i-th component of the mean vector for this generator.
      DoubleMatrix2D getSigma()
      Returns the covariance matrix Σ used by this generator.
      void nextPoint(double[] p)
      Generates a point from this multinormal distribution.
      void setMu(double[] mu)
      Sets the mean vector to mu.
      void setMu(int i, double mui)
      Sets the i-th component of the mean vector to mui.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MultinormalGen

        public MultinormalGen(NormalGen gen1,
                              int d)
        Constructs a generator with the standard multinormal distribution (with μ = 0 and Σ = I) in d dimensions. Each vector Z will be generated via d successive calls to gen1, which must be a standard normal generator.
        Parameters:
        gen1 - the one-dimensional generator
        d - the dimension of the generated vectors
        Throws:
        java.lang.IllegalArgumentException - if the one-dimensional normal generator uses a normal distribution with μ not equal to 0, or σ not equal to 1.
        java.lang.IllegalArgumentException - if d is negative.
        java.lang.NullPointerException - if gen1 is null.
    • Method Detail

      • getMu

        public double[] getMu()
        Returns the mean vector used by this generator.
        Returns:
        the current mean vector.
      • getMu

        public double getMu(int i)
        Returns the i-th component of the mean vector for this generator.
        Parameters:
        i - the index of the required component.
        Returns:
        the value of μi.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if i is negative or greater than or equal to getDimension.
      • setMu

        public void setMu(double[] mu)
        Sets the mean vector to mu.
        Parameters:
        mu - the new mean vector.
        Throws:
        java.lang.NullPointerException - if mu is null.
        java.lang.IllegalArgumentException - if the length of mu does not correspond to getDimension.
      • setMu

        public void setMu(int i,
                          double mui)
        Sets the i-th component of the mean vector to mui.
        Parameters:
        i - the index of the modified component.
        mui - the new value of μi.
        Throws:
        java.lang.ArrayIndexOutOfBoundsException - if i is negative or greater than or equal to getDimension.
      • getSigma

        public DoubleMatrix2D getSigma()
        Returns the covariance matrix Σ used by this generator.
        Returns:
        the used covariance matrix.
      • nextPoint

        public void nextPoint(double[] p)
        Generates a point from this multinormal distribution.
        Specified by:
        nextPoint in class RandomMultivariateGen
        Parameters:
        p - the array to be filled with the generated point

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.