datan

## Class DatanRandom

- java.lang.Object
- - datan.DatanRandom

-     public final class DatanRandom
      extends java.lang.Object

  A class providing methods for computing random numbers

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DatanRandom()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double[]` | `ecuy(int n)` Combination of two MLC generators which returns an array containing n random numbers; the method is also the basis for all other genrators in this class except mlcg.
    `static int` | `getSeedMlcg()` gets current seed of MLC generator.
    `static int[]` | `getSeedsEcuy()` gets current seeds of combined generator Ecuy; seeds has 2 elements.
    `static void` | `line(double a, double b, double t0, double dt, double sigmay, double[] t, double[] y)` generates points on a line with measurement errors; equation of line is y=a*t + b; array t will contain abscissa values beginning with t0 and incremented by dt; array y will contain ordinate values with Gaussian error of width sigmay.
    `static double[]` | `mlcg(int n)` MLC generator which returns an array containing n random numbers.
    `static DatanVector` | `multivariateNormal(DatanVector aa)` returns a vector whose elements are distributed according to a multivariate normal distribution with mean aa and covariance matrix c; the matrix c has to be set prior to using this method by the method setCovarianceMatrixForMultivariateNormal(DatanMatrix c).
    `static double` | `radio(double a, double tau1, double tau2)` generates a decay time; it is assumed that the source consists of a fraction a of nuclei with mean life tau1 and a fraction (1-a) of nuclei of mean life tau2.
    `static void` | `setCovarianceMatrixForMultivariateNormal(DatanMatrix c)` sets the covariance matrix of a multivariate normal distribution for the subsequent use in the method multivariateNormal(DatanVector aa).
    `static void` | `setSeedMlcg(int seed)` sets seed for MLC generator.
    `static void` | `setSeedsEcuy(int[] seeds)` sets seeds for combined generator Ecuy; seeds has 2 elements.
    `static double[]` | `standardNormal(int n)` returns an array containing n random numbers following the standard normal distribution; internally the method uses the combined generator Ecuy.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DatanRandom

          public DatanRandom()

  - ### Method Detail

    - #### mlcg

          public static double[] mlcg(int n)

      MLC generator which returns an array containing n random numbers.

    - #### setSeedMlcg

          public static void setSeedMlcg(int seed)

      sets seed for MLC generator.

    - #### getSeedMlcg

          public static int getSeedMlcg()

      gets current seed of MLC generator.

    - #### ecuy

          public static double[] ecuy(int n)

      Combination of two MLC generators which returns an array containing n random numbers; the method is also the basis for all other genrators in this class except mlcg.

    - #### setSeedsEcuy

          public static void setSeedsEcuy(int[] seeds)

      sets seeds for combined generator Ecuy; seeds has 2 elements.

    - #### getSeedsEcuy

          public static int[] getSeedsEcuy()

      gets current seeds of combined generator Ecuy; seeds has 2 elements.

    - #### standardNormal

          public static double[] standardNormal(int n)

      returns an array containing n random numbers following the standard normal distribution; internally the method uses the combined generator Ecuy.

    - #### setCovarianceMatrixForMultivariateNormal

          public static void setCovarianceMatrixForMultivariateNormal(DatanMatrix c)

      sets the covariance matrix of a multivariate normal distribution for the subsequent use in the method multivariateNormal(DatanVector aa).

    - #### multivariateNormal

          public static DatanVector multivariateNormal(DatanVector aa)

      returns a vector whose elements are distributed according to a multivariate normal distribution with mean aa and covariance matrix c; the matrix c has to be set prior to using this method by the method setCovarianceMatrixForMultivariateNormal(DatanMatrix c).

    - #### line

          public static void line(double a,
                  double b,
                  double t0,
                  double dt,
                  double sigmay,
                  double[] t,
                  double[] y)

      generates points on a line with measurement errors; equation of line is y=a*t + b; array t will contain abscissa values beginning with t0 and incremented by dt; array y will contain ordinate values with Gaussian error of width sigmay.

    - #### radio

          public static double radio(double a,
                     double tau1,
                     double tau2)

      generates a decay time; it is assumed that the source consists of a fraction a of nuclei with mean life tau1 and a fraction (1-a) of nuclei of mean life tau2.