Tabnine Logo
Logarithmic
Code IndexAdd Tabnine to your IDE (free)

How to use
Logarithmic
in
cern.jet.random.tdouble

Best Java code snippets using cern.jet.random.tdouble.Logarithmic (Showing top 8 results out of 315)

origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a random number from the distribution.
 */
public static double staticNextDouble(double p) {
  synchronized (shared) {
    return shared.nextDouble(p);
  }
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Constructs a Logarithmic distribution.
 */
public Logarithmic(double p, DoubleRandomEngine randomGenerator) {
  setRandomGenerator(randomGenerator);
  setState(p);
}
origin: net.sourceforge.parallelcolt/parallelcolt

  /**
   * Sets the uniform random number generated shared by all <b>static</b>
   * methods.
   * 
   * @param randomGenerator
   *            the new uniform random number generator to be shared.
   */
  private static void xstaticSetRandomGenerator(DoubleRandomEngine randomGenerator) {
    synchronized (shared) {
      shared.setRandomGenerator(randomGenerator);
    }
  }
}
origin: rwl/ParallelColt

  /**
   * Sets the uniform random number generated shared by all <b>static</b>
   * methods.
   * 
   * @param randomGenerator
   *            the new uniform random number generator to be shared.
   */
  private static void xstaticSetRandomGenerator(DoubleRandomEngine randomGenerator) {
    synchronized (shared) {
      shared.setRandomGenerator(randomGenerator);
    }
  }
}
origin: rwl/ParallelColt

/**
 * Constructs a Logarithmic distribution.
 */
public Logarithmic(double p, DoubleRandomEngine randomGenerator) {
  setRandomGenerator(randomGenerator);
  setState(p);
}
origin: rwl/ParallelColt

/**
 * Returns a random number from the distribution.
 */
public static double staticNextDouble(double p) {
  synchronized (shared) {
    return shared.nextDouble(p);
  }
}
origin: net.sourceforge.parallelcolt/parallelcolt

/**
 * Returns a random number from the distribution; bypasses the internal
 * state.
 */
public double nextDouble(double a) {
  /***********************************************************************
   * * Logarithmic Distribution - Inversion/Transformation * *
   * ***************************************************************** *
   * The algorithm combines Inversion and Transformation. * It is based on
   * the following fact: A random variable X from * the Logarithmic
   * distribution has the property that X for fixed * Y=y is Geometric
   * distributed with P(X=x|Y=y)=(1-y)*y^(x-1) (*) * where Y has
   * distribution function F(y)=ln(1-y)/ln(1-p). * So first random numbers
   * y are generated by simple Inversion, * then k=(long int)
   * (1+ln(u)/ln(y)) is a Geometric random number * and because of (*) a
   * Logarithmic one. * To speed up the algorithm squeezes are used as
   * well as the * fact, that many of the random numbers are 1 or 2
   * (depending on * special circumstances). * On an IBM/PC 486 optimal
   * performance is achieved, if for p<.97 * simple inversion is used and
   * otherwise the transformation. * On an IBM/PC 286 inversion should be
   * restricted to p<.90. * *
   * ***************************************************************** *
   * FUNCTION: - lsk samples a random number from the * Logarithmic
   * distribution with * parameter 0 < p < 1 . * REFERENCE: - A.W. Kemp
   * (1981): Efficient generation of * logarithmically distributed
   * pseudo-random * variables, Appl. Statist. 30, 249-253. * SUBPROGRAMS:
   * - drand(seed) ... (0,1)-Uniform generator with * unsigned long
   * integer *seed. * *
   **********************************************************************/
  double u, v, p, q;
origin: rwl/ParallelColt

/**
 * Returns a random number from the distribution; bypasses the internal
 * state.
 */
public double nextDouble(double a) {
  /***********************************************************************
   * * Logarithmic Distribution - Inversion/Transformation * *
   * ***************************************************************** *
   * The algorithm combines Inversion and Transformation. * It is based on
   * the following fact: A random variable X from * the Logarithmic
   * distribution has the property that X for fixed * Y=y is Geometric
   * distributed with P(X=x|Y=y)=(1-y)*y^(x-1) (*) * where Y has
   * distribution function F(y)=ln(1-y)/ln(1-p). * So first random numbers
   * y are generated by simple Inversion, * then k=(long int)
   * (1+ln(u)/ln(y)) is a Geometric random number * and because of (*) a
   * Logarithmic one. * To speed up the algorithm squeezes are used as
   * well as the * fact, that many of the random numbers are 1 or 2
   * (depending on * special circumstances). * On an IBM/PC 486 optimal
   * performance is achieved, if for p<.97 * simple inversion is used and
   * otherwise the transformation. * On an IBM/PC 286 inversion should be
   * restricted to p<.90. * *
   * ***************************************************************** *
   * FUNCTION: - lsk samples a random number from the * Logarithmic
   * distribution with * parameter 0 < p < 1 . * REFERENCE: - A.W. Kemp
   * (1981): Efficient generation of * logarithmically distributed
   * pseudo-random * variables, Appl. Statist. 30, 249-253. * SUBPROGRAMS:
   * - drand(seed) ... (0,1)-Uniform generator with * unsigned long
   * integer *seed. * *
   **********************************************************************/
  double u, v, p, q;
cern.jet.random.tdoubleLogarithmic

Javadoc

Logarithmic distribution.

Valid parameter ranges: 0 < p < 1.

Instance methods operate on a user supplied uniform random number generator; they are unsynchronized. Static methods operate on a default uniform random number generator; they are synchronized.

Implementation: Method: Inversion/Transformation. This is a port of lsk.c from the C-RAND / WIN-RAND library. C-RAND's implementation, in turn, is based upon

A.W. Kemp (1981): Efficient generation of logarithmically distributed pseudo-random variables, Appl. Statist. 30, 249-253.

Most used methods

  • nextDouble
  • setRandomGenerator
  • setState
    Sets the distribution parameter.

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • JOptionPane (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now