Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.randvar
Class Rand1

    java.lang.Object
      umontreal.iro.lecuyer.randvar.Rand1

Deprecated. Use `RandomVariateGen` and `RandomVariateGenInt` instead.

    public class Rand1

extends Object

This static class provides a few methods for generating random variates from various distributions, using a given random stream. All the methods given here use inversion.

This is an OLD class that is DEPRECATED. Equivalent methods in the appropriate classes of this package should be used instead.

Method Summary
`static int` | `binomial(RandomStream s, int n, double p)` Deprecated. Returns a random variate having the binomial distribution with parameters n and p, using stream `s`.
`static double` | `chiSquare(RandomStream s, int n)` Deprecated. Returns a random variate having the ChiSquare distribution with parameters n.
`static double` | `erlang(RandomStream s, int k, double mu)` Deprecated. Returns a random variate having the Erlang distribution.
`static double` | `expon(RandomStream s, double mean)` Deprecated. Returns a random variate having the exponential distribution with mean = `mean`, using stream `s`.
`static int` | `geometric(RandomStream s, double p)` Deprecated. Returns a random variate having the geometric distribution with parameter p, where 0 < p < 1, using stream `s`.
`static double` | `gumbel(RandomStream s, double alpha, double lambda)` Deprecated. Returns a random variate having the Gumbel distribution with parameters alpha and lambda (see, Problem 8.1).
`static double` | `invStudentDist(int n, double u)` Deprecated. Returns y = F-1(u), where F is the Student distribution function with `n` degrees of freedom.
`static double` | `Logistic(RandomStream s, double alpha, double lambda)` Deprecated. Returns a Logistic random variate with parameters `alpha` and standard deviation `lambda`, using stream `s`.
`static double` | `lognormal(RandomStream s, double mu, double sigma)` Deprecated. Returns a random variate having the lognormal distribution.
`static int` | `negativeBinomial(RandomStream s, int n, double p)` Deprecated. Returns a random variate having the binomial distribution with parameters n and p, using stream `s`.
`static double` | `normal(RandomStream s, double mean, double sigma)` Deprecated. Returns a normal random variate with mean mu and standard deviation sigma using stream `s`.
`static double` | `pareto(RandomStream s, double alpha, double beta)` Deprecated. Returns a random variate having the Pareto distribution with parameters alpha and (see, Problem 8.1).
`static int` | `poisson(RandomStream s, double lambda)` Deprecated. Returns a random variate having the Poisson distribution with parameter (mean) lambda.
`static double` | `student(RandomStream s, int n)` Deprecated. Returns a random variate having the Student distribution with `n` degrees of freedom, using stream `s`.
`static double` | `uniform(RandomStream s, double a, double b)` Deprecated. Returns a random variate having the uniform distribution over the real interval (a, b), using stream `s`.
`static double` | `weibull(RandomStream s, double alpha, double lambda, double delta)` Deprecated. Returns a random variate having the Weibull distribution.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### uniform

    public static double uniform(RandomStream s,
                                 double a,
                                 double b)

  Deprecated.
  Returns a random variate having the uniform distribution over the real interval (a, b), using stream `s`. The returned value is always strictly between a and b.

### expon

    public static double expon(RandomStream s,
                               double mean)

  Deprecated.
  Returns a random variate having the exponential distribution with mean = `mean`, using stream `s`. Uses inversion.

### erlang

    public static double erlang(RandomStream s,
                                int k,
                                double mu)

  Deprecated.
  Returns a random variate having the Erlang distribution. It has parameters (k,[tex2html_wrap_inline329]), which is the sum of k exponential random variables with mean [tex2html_wrap_inline332]. The mean of this Erlang random variable is k[tex2html_wrap_inline334]. This method simply generates k exponentials by calling `ExponentialDist.inverseF` k times with stream `s`, and returns the sum.

### weibull

    public static double weibull(RandomStream s,
                                 double alpha,
                                 double lambda,
                                 double delta)

  Deprecated.
  Returns a random variate having the Weibull distribution. It has parameters = `alpha` and = `lambda`, using stream `s`. This Weibull distribution function is F(x) = 1 - e-x for x > 0. The mean is given by (1+1/[tex2html_wrap_inline347])/. Restrictions: must have [tex2html_wrap_inline350] > 0 et [tex2html_wrap_inline352] > 0. Uses inversion.

### normal

    public static double normal(RandomStream s,
                                double mean,
                                double sigma)

  Deprecated.
  Returns a normal random variate with mean mu and standard deviation sigma using stream `s`. Uses inversion via `invNormalDist`.

### Logistic

    public static double Logistic(RandomStream s,
                                  double alpha,
                                  double lambda)

  Deprecated.
  Returns a Logistic random variate with parameters `alpha` and standard deviation `lambda`, using stream `s`. Uses inversion via .

### student

    public static double student(RandomStream s,
                                 int n)

  Deprecated.
  Returns a random variate having the Student distribution with `n` degrees of freedom, using stream `s`. Uses inversion via `invStudentDist`.

### invStudentDist

    public static double invStudentDist(int n,
                                        double u)

  Deprecated.
  Returns y = F-1(u), where F is the Student distribution function with `n` degrees of freedom.

### lognormal

    public static double lognormal(RandomStream s,
                                   double mu,
                                   double sigma)

  Deprecated.
  Returns a random variate having the lognormal distribution. It has parameters [tex2html_wrap_inline364] and [tex2html_wrap_inline366], i.e., whose natural logarithm is normal with mean [tex2html_wrap_inline368] and variance . Generates a normal by inversion and takes the exponential.

### chiSquare

    public static double chiSquare(RandomStream s,
                                   int n)

  Deprecated.
  Returns a random variate having the ChiSquare distribution with parameters n. Uses inversion.

### gumbel

    public static double gumbel(RandomStream s,
                                double alpha,
                                double lambda)

  Deprecated.
  Returns a random variate having the Gumbel distribution with parameters alpha and lambda (see, Problem 8.1). Uses inversion.

### pareto

    public static double pareto(RandomStream s,
                                double alpha,
                                double beta)

  Deprecated.
  Returns a random variate having the Pareto distribution with parameters alpha and (see, Problem 8.1). Uses inversion.

### binomial

    public static int binomial(RandomStream s,
                               int n,
                               double p)

  Deprecated.
  Returns a random variate having the binomial distribution with parameters n and p, using stream `s`. The parameter p must be in [0, 1]. This method is efficient only for small n (say, n <= 10).

### negativeBinomial

    public static int negativeBinomial(RandomStream s,
                                       int n,
                                       double p)

  Deprecated.
  Returns a random variate having the binomial distribution with parameters n and p, using stream `s`. The parameter p must be in [0, 1]. This method is efficient only for small n (say, n <= 10).

### geometric

    public static int geometric(RandomStream s,
                                double p)

  Deprecated.
  Returns a random variate having the geometric distribution with parameter p, where 0 < p < 1, using stream `s`. Uses inversion.

### poisson

    public static int poisson(RandomStream s,
                              double lambda)

  Deprecated.
  Returns a random variate having the Poisson distribution with parameter (mean) lambda. One must have lambda > 0 and this method is efficient only for small lambda (say, lambda <= 10).

  Uses Tabulated Inversion combined with Acceptance Complement strongly inspired from the UNURAN library.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SSJ V. 2.1.1.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.