Documentation of 'umontreal.iro.lecuyer.randvar.UnuranEmpirical' Java class
UnuranEmpirical
umontreal.iro.lecuyer.randvar

Class UnuranEmpirical



  • public class UnuranEmpirical
    extends RandomVariateGen
    This class permits one to create generators for empirical and quasi-empirical univariate distributions using UNURAN via its string interface. The empirical data can be read from a file, from an array, or simply encoded into the generator specification string. When reading from a file or an array, the generator specification string must not contain a distribution specification string.
    • Constructor Detail

      • UnuranEmpirical

        public UnuranEmpirical(RandomStream s,
                               java.lang.String genStr)
        Constructs a new empirical univariate generator using the specification string genStr and stream s.
      • UnuranEmpirical

        public UnuranEmpirical(RandomStream s,
                               RandomStream aux,
                               java.lang.String genStr)
        Constructs a new empirical univariate generator using the specification string genStr, with main stream s and auxiliary stream aux.
      • UnuranEmpirical

        public UnuranEmpirical(RandomStream s,
                               RandomStream aux,
                               PiecewiseLinearEmpiricalDist dist,
                               java.lang.String genStr)
        Same as UnuranEmpirical(s, aux, genStr), but reading the observations from the empirical distribution dist. The genStr argument must not contain a distribution part because the distribution will be generated from the input stream reader.
    • Method Detail

      • nextDouble

        public double nextDouble()
        Description copied from class: RandomVariateGen
        Generates a random number from the continuous distribution contained in this object. By default, this method uses inversion by calling the inverseF method of the distribution object. Alternative generating methods are provided in subclasses.
        Overrides:
        nextDouble in class RandomVariateGen
        Returns:
        the generated value
      • nextArrayOfDouble

        public void nextArrayOfDouble(double[] v,
                                      int start,
                                      int n)
        Description copied from class: RandomVariateGen
        Generates n random numbers from the continuous distribution contained in this object. These numbers are stored in the array v, starting from index start. By default, this method calls nextDouble() n times, but one can override it in subclasses for better efficiency.
        Overrides:
        nextArrayOfDouble in class RandomVariateGen
        Parameters:
        v - array in which the variates will be stored
        start - starting index, in v, of the new variates
        n - number of variates to generate
      • getAuxStream

        public RandomStream getAuxStream()
        Returns the auxiliary random number stream.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.