package random
The random
package contains classes, traits and objects for
the generation of random numbers.
- Alphabetic
- By Inheritance
- random
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
Bernoulli(p: Double = .5, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Bernoulli
random variates.This class generates
Bernoulli
random variates. This discrete RV models the one trial (success is 1, failure is 0).- p
the probability of success
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/bernoulli/Introduction.html
-
case class
Beta(alpha: Double = 2, beta: Double = 3, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Beta
random variates.This class generates
Beta
random variates. This continuous RV models random proportions. Beta = Gamma1 / (Gamma1 + Gamma2).- alpha
the shape parameter for Gamma1
- beta
the shape parameter for Gamma2
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Beta.html
-
case class
Binomial(p: Double = .5, n: Int = 10, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Binomial
random variates.This class generates
Binomial
random variates. This discrete RV models the number of successes in n trials.- p
the probability of success
- n
the number of independent trials
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/bernoulli/Binomial.html
-
trait
CDFTest extends AnyRef
The
CDFTest
trait provides methods for testing theCDF
object. -
case class
Cauchy(alpha: Double = 2.5, beta: Double = 1.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Cauchy
(or Lorentz) random variates.This class generates
Cauchy
(or Lorentz) random variates. This continuous RV models data with heavier tails than normally distributed.- alpha
the location parameter (median)
- beta
the scale parameter
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Cauchy.html
-
case class
ChiSquare(df: Int = 2, stream: Int = 0) extends Variate with Product with Serializable
This class generates
ChiSquare
random variates.This class generates
ChiSquare
random variates. This continuous RV models the variance of a distribution.- df
the degrees of freedom
- stream
the random number stream
- See also
www.math.uah.edu/stat/special/ChiSquare.html
-
case class
Dice(cdf: Array[Double] = Array (.1, .3, .5, .7, .9, 1.0), stream: Int = 0) extends Variate with Product with Serializable
This class generates
Dice
random variates for a given distribution specified using a cumulative distribution function (cdf).This class generates
Dice
random variates for a given distribution specified using a cumulative distribution function (cdf). This discrete RV models the roll of dice numbered 0, 1, ..., n-1. Add 1 for 1 to n.- cdf
the distribution function (cdf)
- stream
the random number stream
- See also
Randi
for an easy way to use fair dice 'Randi (1, 6)'.
-
case class
Dir(alpha: VectoD, stream: Int = 0) extends Product with Serializable
The
Dir
class generates Dirichlet random variables.The
Dir
class generates Dirichlet random variables. The Dirichlet distribution is the distribution over the space of multinomial distributions.- alpha
the concentration parameters
- stream
the random number stream
- See also
en.wikipedia.org/wiki/Dirichlet_distribution
www.quora.com/What-is-an-intuitive-explanation-of-the-Dirichlet-distribution
-
case class
Discrete(dist: VectoD = VectorD (.2, .2, .2, .2, .2), x: VectorD = null, cumulative: Boolean = false, stream: Int = 0) extends Variate with Product with Serializable
This class generates generalized
Discrete
random variates for a given distribution specified using either a probability mass function (pmf) or a cumulative distribution function (cdf).This class generates generalized
Discrete
random variates for a given distribution specified using either a probability mass function (pmf) or a cumulative distribution function (cdf). This discrete RV models arbitrary experiments with discrete outcomes.- dist
the distribution function (pdf or cdf)
- x
the x-coordinate values (mass points)
- cumulative
whether 'dist' is cumulative (cdf) or not (pmf)
- stream
the random number stream
-
case class
DiscreteF(f: Array[FunctionS2S] = Array ((x: Double) => x), stream: Int = 0) extends Variate with Product with Serializable
The
DiscreteF
class generates generalizedDiscrete
random variates for a distribution specified via an array of functions (FunctionS2S).The
DiscreteF
class generates generalizedDiscrete
random variates for a distribution specified via an array of functions (FunctionS2S). At a particular time 't', the functions must some to one. This discrete RV models time-varying experiments with discrete outcomes.- f
the array of time-based functions
- stream
the random number stream
-
type
Distribution = (Double, Parameters) ⇒ Double
The function type for distribution functions, including (1) Cumulative Distribution Function (CDF) (2) inverse Cumulative Distribution Function (iCDF) The arguments are
Double
for coordinate 'x' or probability 'p' and aVector
of parameters, e.g., degrees of freedom. -
case class
Erlang(mu: Double = 1.0, k: Int = 2, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Erlang
random variates.This class generates
Erlang
random variates. This continuous RV models the time until k stages complete.- mu
the mean of exponential samples (Erlang mean = mu * k)
- k
the number of stages (or Exponential samples)
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/poisson/Gamma.html
-
case class
Exponential(mu: Double = 1.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Exponential
random variates.This class generates
Exponential
random variates. This continuous RV models the time until an event occurs.- mu
the mean
- stream
the random number stream
- See also
www.math.uah.edu/stat/poisson/Exponential.html
-
case class
Fisher(df1: Int = 6, df2: Int = 4, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Fisher
(F-Distribution) random variates.This class generates
Fisher
(F-Distribution) random variates. This continuous RV models the ratio of variances.- df1
the degrees of freedom for numerator Chi-Square
- df2
the degrees of freedom for denominator Chi-Square
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Fisher.html
-
case class
Gamma(alpha: Double = 1.0, beta: Double = 1.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Gamma
random variates.This class generates
Gamma
random variates. This continuous RV models the time until an event occurs. Note: variance = alpha * beta ^ 2.- alpha
the shape parameter
- beta
the scale parameter
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/poisson/Gamma.html
-
case class
Geometric(p: Double = .5, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Geometric
random variates.This class generates
Geometric
random variates. This discrete RV models the number of failures before the first success.- p
the probability of success
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/bernoulli/Geometric.html
-
case class
HyperExponential(p: Double = .5, mu1: Double = 1, mu2: Double = 2, stream: Int = 0) extends Variate with Product with Serializable
This class generates
HyperExponential
random variates (two rates).This class generates
HyperExponential
random variates (two rates). This continuous RV models the time until an event occurs (higher coefficient of variation than exponential distribution).- p
the probability of first vs. second rates
- mu1
the first mean (1 / lambda1)
- mu2
the second mean (1 / lambda2)
- stream
the random number stream
-
case class
HyperGeometric(p: Double = .5, n: Int = 5, pop: Int = 10, stream: Int = 0) extends Variate with Product with Serializable
This class generates
HyperGeometric
random variates.This class generates
HyperGeometric
random variates. This discrete RV models the number of successes in n draws from a finite population.- p
the probability of success (red balls)
- n
the number of draws (balls drawn)
- pop
the size of the finite population (total number of balls)
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/urn/Hypergeometric.html
-
case class
LogNormal(mu: Double = 0.0, sigma2: Double = 1.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
LogNormal
random variates.This class generates
LogNormal
random variates. This continuous RV models data that is normally distributed after a log transformation.- mu
the mean for underlying Normal
- sigma2
the variance (sigma squared) for underlying Normal
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/LogNormal.html
-
case class
Logistic(a: Double = 0.0, b: Double = 1.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Logistic
random variates.This class generates
Logistic
random variates. This continuous RV models logistically distributed data (stretched Normal).- a
the location parameter
- b
the scale parameter
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Logistic.html
-
case class
Multinomial(p: Array[Double] = Array (.4, .7, 1.0), n: Int = 5, stream: Int = 0) extends VariateVec with Product with Serializable
The
Multinomial
class generates random variate vectors following the multinomial distribution.The
Multinomial
class generates random variate vectors following the multinomial distribution. This discrete RV models the multinomial trials, which generalize Bernoulli trials ({0, 1} to the case where the outcome is in {0, 1, ..., k-1}.- p
array of cumulative probabilities as CDF values
- n
the number of independent trials
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/bernoulli/Multinomial.html
-
case class
NHPoissonProcess(lambda: VectorD, dt: Double = 1.0, stream: Int = 0) extends TimeVariate with Product with Serializable
This class generates arrival times according to a
NHPoissonProcess
, an Non-Homogeneous Process Process (NHPP), where the arrival rate function 'lambda(t)' is piece-wise constant.This class generates arrival times according to a
NHPoissonProcess
, an Non-Homogeneous Process Process (NHPP), where the arrival rate function 'lambda(t)' is piece-wise constant. Rates are constant over basic time intervals of length 'dt'.- lambda
the vector of arrival rates
- dt
the length the basic time intervals
- stream
the random number stream
- See also
http://en.wikipedia.org/wiki/Poisson_process#Non-homogeneous
-
case class
NegativeBinomial(p: Double = .5, s: Int = 2, stream: Int = 0) extends Variate with Product with Serializable
This class generates
NegativeBinomial
random variates.This class generates
NegativeBinomial
random variates. This discrete RV models the number of failures before s-th success.- p
the probability of success
- s
the number of successes
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/bernoulli/NegativeBinomial.html
-
case class
Normal(mu: Double = 0.0, sigma2: Double = 1.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Normal
(Gaussian) random variates.This class generates
Normal
(Gaussian) random variates. This continuous RV models normally distributed data (bell curve). When summed, most distributions tend to Normal (Central Limit Theorem).- mu
the mean
- sigma2
the variance (sigma squared)
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Normal.html
-
case class
NormalVec(mu: VectoD, cov: MatrixD, stream: Int = 0) extends VariateVec with Product with Serializable
The
NormalVec
class generates Normal (Gaussian) random variate vectors according to the Multivariate Normal distribution with mean 'mu' and covariance 'cov'.The
NormalVec
class generates Normal (Gaussian) random variate vectors according to the Multivariate Normal distribution with mean 'mu' and covariance 'cov'. This continuous RVV models normally distributed multidimensional data.- mu
the mean vector
- cov
the covariance matrix
- stream
the random number stream
- See also
http://www.statlect.com/mcdnrm1.htm
http://onlinelibrary.wiley.com/doi/10.1111/1467-9639.00037/pdf
-
type
Parameters = Vector[Double]
Type definition for parameters to a distribution.
Type definition for parameters to a distribution.
Vector
is used instead ofArray
since they are covariant, while Scala arrays are not. -
case class
Pareto(a: Double = 1.0, b: Double = 0.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Pareto
random variates.This class generates
Pareto
random variates. This continuous RV models Pareto distributed data.- a
the shape parameter
- b
the scale parameter
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Pareto.html
-
case class
PermutedVecD(x: VectoD, stream: Int = 0) extends VariateVec with Product with Serializable
The
PermutedVecD
class generates random permutations of a vector of doubles.The
PermutedVecD
class generates random permutations of a vector of doubles.- x
the vector of doubles to permute
- stream
the random number stream
- See also
maths-people.anu.edu.au/~brent/pd/Arndt-thesis.pdf
-
case class
PermutedVecI(x: VectoI, stream: Int = 0) extends VariateVec with Product with Serializable
The
PermutedVecI
class generates random permutations of a vector of integers.The
PermutedVecI
class generates random permutations of a vector of integers.- x
the vector of integers to permute
- stream
the random number stream
- See also
maths-people.anu.edu.au/~brent/pd/Arndt-thesis.pdf
-
case class
Poisson(mu: Double = 2.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Poisson
random variates (discrete).This class generates
Poisson
random variates (discrete). This discrete RV models the number of events in a time interval of unit length.- mu
the mean
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/poisson/Poisson.html
-
case class
PoissonProcess(lambda: Double, stream: Int = 0) extends TimeVariate with Product with Serializable
This class generates arrival times according to a
PoissonProcess
.This class generates arrival times according to a
PoissonProcess
. Given the current arrival time 't', generate the next arrival time.- lambda
the arrival rate (arrivals per unit time)
- stream
the random number stream
- See also
http://en.wikipedia.org/wiki/Poisson_process
-
case class
PowerLaw(a: Double = 1.0, b: Double = 10.0, y: Double = 2.1, stream: Int = 0) extends Variate with Product with Serializable
This class generates
PowerLaw
random variates: 'cx^-y' for 'x in [a, b]'. This continuous RV models power-law distributions.This class generates
PowerLaw
random variates: 'cx^-y' for 'x in [a, b]'. This continuous RV models power-law distributions.- a
the minimum value parameter
- b
the maximum value parameter
- y
the power parameter to be used
- stream
the random number stream
- See also
http://mathworld.wolfram.com/RandomNumber.html
-
case class
ProbabilityVec(n: Int, d: Double = 0.5, stream: Int = 0) extends VariateVec with Product with Serializable
The
ProbabilityVec
class generates a probability vector where the 'i'th probability is '1/n' with a +/- randomizing displacement of at most 'd'.The
ProbabilityVec
class generates a probability vector where the 'i'th probability is '1/n' with a +/- randomizing displacement of at most 'd'. Note, the probability vector must add to one.- n
the dimension/size of the probability vector
- d
the randomizing displacement, must be in [0, 1]
-
trait
QuantileTest extends AnyRef
The
QuantileTest
trait provides methods for testing theQuantile
object. -
abstract
class
RNG extends Error
The
RNG
abstract class is the base class for all ScalaTion Random Number Generators.The
RNG
abstract class is the base class for all ScalaTion Random Number Generators. The subclasses must implement a 'gen' method that generates random real numbers in the range (0, 1). They must also implement an 'igen' methods to return stream values. -
case class
Randi(a: Int = 0, b: Int = 5, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Randi
random variates (random integers: a, ..., b).This class generates
Randi
random variates (random integers: a, ..., b). This discrete RV models equi-probable integral outcomes.- a
the lower bound (inclusive)
- b
the upper bound (inclusive)
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/UniformDiscrete.html
-
case class
Randi0(b: Int = 5, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Randi0
random variates (random integers: 0, ..., b).This class generates
Randi0
random variates (random integers: 0, ..., b). This discrete RV models equi-probable integral outcomes starting with 0.- b
the upper bound (>= 0) (inclusive)
- stream
the random number stream
-
case class
RandiU0(b: Int = 5, stream: Int = 0) extends Variate with Product with Serializable
This class generates
RandiU0
random variates (unique random integers: 0, ..., b).This class generates
RandiU0
random variates (unique random integers: 0, ..., b). This discrete RV models equi-probable integral outcomes starting with 0.- b
the upper bound (>= 0) (inclusive)
- stream
the random number stream
-
case class
Random(stream: Int = 0) extends RNG with Product with Serializable
The
Random
class generates random real numbers in the range (0, 1).The
Random
class generates random real numbers in the range (0, 1). It implements, using 64-bit integers (Long's), the 'MRG31k3p' generator developed by L'Ecuyer and Touzin, described in "FAST COMBINED MULTIPLE RECURSIVE GENERATORS WITH MULTIPLIERS OF THE FORM a = 2q +/- 2r". MRG31k3p is a Combined Multiple Recursive Generator (CMRG) shown to have good performance and statistical properties for simulations. It has a period of about 2185 and is considered to be a faster alternative to the popular 'MRG32k3' generator. MRG31k3p combines MRG1 and MRG2.
MRG1: x_i = (0 + a_12 x_i-2 + a_13 x_i-3) % M1 MRG2: x_i = (a_21 x_i-1 + 0 + a_23 x_i-3) % M2
where a_12 = 222, a_13 = 27+1, a_21 = 215 and a_23 = 2^15+1.- stream
the random number stream index
- See also
http://www.iro.umontreal.ca/~simardr/ssj/doc/pdf/guiderng.pdf
http://www.informs-sim.org/wsc00papers/090.PDF
-
case class
Random2(stream: Int = 0) extends RNG with Product with Serializable
The
Random2
class generates random real numbers in the range (0, 1).The
Random2
class generates random real numbers in the range (0, 1). It implements, using 32-bit integers (Int's), the 'MRG31k3p' generator developed by L'Ecuyer and Touzin, described in "FAST COMBINED MULTIPLE RECURSIVE GENERATORS WITH MULTIPLIERS OF THE FORM a = 2q +/- 2r". MRG31k3p is a Combined Multiple Recursive Generator (CMRG) shown to have good performance and statistical properties for simulations. It has a period of about 2185 and is considered to be a faster alternative to the popular 'MRG32k3' generator. MRG31k3p combines MRG1 and MRG2.
MRG1: x_i = (0 + a_12 x_i-2 + a_13 x_i-3) % M1 MRG2: x_i = (a_21 x_i-1 + 0 + a_23 x_i-3) % M2
where a_12 = 222, a_13 = 27+1, a_21 = 215 and a_23 = 2^15+1.- stream
the random number stream index
- See also
http://www.iro.umontreal.ca/~simardr/ssj/doc/pdf/guiderng.pdf
http://www.informs-sim.org/wsc00papers/090.PDF
-
case class
Random3(stream: Int = 0) extends RNG with Product with Serializable
The
Random3
class generates random real numbers in the range (0, 1).The
Random3
class generates random real numbers in the range (0, 1). It implements, using 64-bit integers (Int's), the 'MINSTD' generator, which is a multiplicative Linear Congruential Generator (LCG). These generators were commonly used in the last century.
x_i = a x_i-1 % m- stream
the random number stream index
- See also
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.1024
Random
http://random.mat.sbg.ac.at/results/karl/server/node4.html#SECTION00042000000000000000 In case a better generator is needed, a Multiple Recursive Generator (MRG) or Composite Multiple Recursive Generator (CMRG) should be used.
-
case class
RandomMatD(dim1: Int = 5, dim2: Int = 10, max: Double = 20.0, min: Double = 0.0, density: Double = 1.0, stream: Int = 0) extends VariateMat with Product with Serializable
The
RandomMatD
class generates a random matrix of doubles.The
RandomMatD
class generates a random matrix of doubles.- dim1
the number of rows in the matrix
- dim2
the number of columns in the matrix
- max
generate integers in the range 0 (inclusive) to max (inclusive)
- min
generate integers in the range 0 (inclusive) to max (inclusive)
- density
sparsity basis = 1 - density
- stream
the random number stream
-
case class
RandomSet(count: Int = 10, max: Int = 20, skip: Int = -1, stream: Int = 0) extends VariateSet with Product with Serializable
The
RandomSet
class generates a random set/subset of integers.The
RandomSet
class generates a random set/subset of integers.- count
the size of the set (number of integer elements)
- max
generate integers in the range 0 (inclusive) to max (inclusive)
- skip
skip this number, i.e, do not use it
- stream
the random number stream
-
case class
RandomSetS(count: Int = 10, stream: Int = 0) extends VariateSet with Product with Serializable
The
RandomSetS
class generates a random set/subset of strings.The
RandomSetS
class generates a random set/subset of strings.- count
the size of the set (number of strings)
- stream
the random number stream
-
case class
RandomSetW(count: Int = 10, nWords: Int = 20, lRange: Range = 4 to 6, cRange: Range = 97 to 122, stream: Int = 0) extends VariateSet with Product with Serializable
The
RandomSetW
class generates a random set/subset of words.The
RandomSetW
class generates a random set/subset of words.- count
the size of the set (number of words)
- nWords
the numbers of words to predetermine.
- lRange
the range of string lengths to generate
- cRange
the range of characters to generate
- stream
the random number stream
-
case class
RandomStr(lRange: Range = 4 to 7, cRange: Range = 97 to 122, stream: Int = 0) extends Variate with Product with Serializable
The
RandomStr
class generates a random string.The
RandomStr
class generates a random string.- lRange
the range of string lengths to generate
- cRange
the range of characters to generate
- stream
the random number stream
-
case class
RandomVecD(dim: Int = 10, max: Double = 20.0, min: Double = 0.0, density: Double = 1.0, runLength: Int = 10, stream: Int = 0) extends VariateVec with Product with Serializable
The
RandomVecD
class generates a random vector of doubles.The
RandomVecD
class generates a random vector of doubles. Ex: (3.0, 2.0, 0.0, 4.0, 1.0) has 'dim' = 5 and 'max' = 4.- dim
the dimension/size of the vector (number of elements)
- max
generate integers in the range min (inclusive) to max (inclusive)
- min
generate integers in the range min (inclusive) to max (inclusive)
- density
sparsity basis = 1 - density
- runLength
the maximum run length
- stream
the random number stream
-
case class
RandomVecI(dim: Int = 10, max: Int = 20, min: Int = 10, skip: Int = -1, unique: Boolean = true, stream: Int = 0) extends VariateVec with Product with Serializable
The
RandomVecI
class generates a random vector of integers.The
RandomVecI
class generates a random vector of integers. Ex: (3, 2, 0, 4, 1) has 'dim' = 5 and 'max' = 4.- dim
the dimension/size of the vector (number of elements)
- max
generate integers in the range min (inclusive) to max (inclusive)
- min
generate integers in the range min (inclusive) to max (inclusive)
- skip
skip this number, i.e, do not use it
- unique
whether the integers must be unique
- stream
the random number stream
-
case class
RandomVecS(dim: Int = 10, unique: Boolean = true, stream: Int = 0) extends VariateVec with Product with Serializable
The
RandomVecS
class generates a random vector of strings.The
RandomVecS
class generates a random vector of strings. Ex: ("3", "2", "0", "4", "1") has 'dim' = 5 and 'max' = 4.- dim
the dimension/size of the vector (number of elements)
- unique
whether the strings must be unique
- stream
the random number stream
-
case class
RandomVecSample(pop: Int, samp: Int, stream: Int = 0) extends VariateVec with Product with Serializable
The
RandomVecSample
class generates random sample from a population.The
RandomVecSample
class generates random sample from a population.- pop
the size of the population (0, 1, ... pop-1)
- samp
the size of the random samples
- stream
the random number stream
-
case class
RandomWord(nWords: Int = 10, lRange: Range = 4 to 6, cRange: Range = 97 to 122, stream: Int = 0) extends Variate with Product with Serializable
The
RandomStr
class generates a random word from a predetermined set.The
RandomStr
class generates a random word from a predetermined set.- nWords
the numbers of words to predetermine.
- lRange
the range of string lengths to generate
- cRange
the range of characters to generate
- stream
the random number stream
-
case class
Sharp(x: Double = 1, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Sharp
(Deterministic) random variates.This class generates
Sharp
(Deterministic) random variates. This discrete RV models the case when the variance is 0.- x
the value for this constant distribution
- stream
the random number stream
-
case class
StudentT(df: Int = 4, stream: Int = 0) extends Variate with Product with Serializable
This class generates
StudentT
(Student's t) random variates.This class generates
StudentT
(Student's t) random variates. This continuous RV models cases where data are normally distributed, but variability increases since the variance is unknown.- df
the degrees of freedom
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Student.html
-
abstract
class
TimeVariate extends Variate
The
TimeVariate
abstract class serves as a superclass for time-based random variates such Poisson Processes. -
case class
Trapezoidal(a: Double = 0.0, c: Double = 2.0, d: Double = 7.0, b: Double = 10.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Trapezoidal
random variates.This class generates
Trapezoidal
random variates. This continuous RV models cases where outcomes cluster between two modes. BothUniform and
Triangularare special cases of
Trapezoidal.
- a
the minimum
- c
the first mode
- d
the second mode
- b
the maximum
- stream
the random number stream
- See also
iopscience.iop.org/0026-1394/44/2/003/pdf/0026-1394_44_2_003.pdf
-
case class
Triangular(a: Double = 0, b: Double = 5, c: Double = Double.MaxValue, stream: Int = 0) extends Variate with Product with Serializable
This class generates simple
Triangular
random variates with the mode in the middle.This class generates simple
Triangular
random variates with the mode in the middle. This continuous RV models cases where outcomes cluster around the mode.- a
the lower bound
- b
the upper bound
- c
the mode
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Triangle.html
-
case class
Trinomial(p: Double = 1.0/3.0, q: Double = 1.0/3.0, n: Int = 5, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Trinomial
random variates.This class generates
Trinomial
random variates. While Binomial is based on trials with two outcomes, success (1) or failure (0). Trinomial is based on trials with three outcomes, high (2), medium (1) or low (0). This discrete RV models the result of 'n' trials.- p
the probability of high (2)
- q
the probability of medium (1)
- n
the number of independent trials
- stream
the random number stream
- See also
onlinecourses.science.psu.edu/stat414/node/106 FIX - fails distribution test - maybe due to 'pf' method
-
case class
Uniform(a: Double = 0.0, b: Double = 5.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Uniform
random variates in the range (a, b).This class generates
Uniform
random variates in the range (a, b). This continuous RV models equi-probable outcomes.- a
the lower bound
- b
the upper bound
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/UniformContinuous.html
-
abstract
class
Variate extends Error
The
Variate
abstract class serves as a base class for all the random variate (RV) generators.The
Variate
abstract class serves as a base class for all the random variate (RV) generators. They use one of the Random Number Generators (RNG's) fromRandom
to generate numbers following their particular distribution. Random Variate Generators (RVG's) for thirty popular probability distributions are implemented as extensions of Variate. Still need to add one.- See also
VariateVec
for Random MultiVariate Generators (RMVG's). -----------------------------------------------------------------------------http://www.math.uah.edu/stat/special/index.html
-
abstract
class
VariateMat extends Error
The
VariateMat
abstract class serves as a base class for all the random variate matrix (RVM) generators.The
VariateMat
abstract class serves as a base class for all the random variate matrix (RVM) generators. They use one of the Random Number Generators (RNG's) from Random.scala to generate numbers following their particular multivariate distribution. ----------------------------------------------------------------------------- -
abstract
class
VariateSet extends Error
The
VariateSet
abstract class serves as a base class for all the random variate set (RVS) generators.The
VariateSet
abstract class serves as a base class for all the random variate set (RVS) generators. They use one of the Random Number Generators (RNG's) from Random.scala to generate numbers following their particular multivariate distribution. ----------------------------------------------------------------------------- -
abstract
class
VariateVec extends Error
The
VariateVec
abstract class serves as a base class for all the random variate vector (RVV) generators.The
VariateVec
abstract class serves as a base class for all the random variate vector (RVV) generators. They use one of the Random Number Generators (RNG's) from Random.scala to generate numbers following their particular multivariate distribution. ----------------------------------------------------------------------------- -
case class
Weibull(alpha: Double = 1.0, beta: Double = 2.0, stream: Int = 0) extends Variate with Product with Serializable
This class generates
Weibull
random variates.This class generates
Weibull
random variates. This continuous RV models the time for an event to occur.- alpha
the shape parameter
- beta
the scale parameter
- stream
the random number stream
- See also
http://www.math.uah.edu/stat/special/Weibull.html
-
case class
_HyperExponential(mu: Double = 1.0, sigma: Double = 2, stream: Int = 0) extends Variate with Product with Serializable
This class generates
HyperExponential
random variates.This class generates
HyperExponential
random variates. This continuous RV models the time until an event occurs (higher coefficient of variation than exponential distribution). FIX- mu
the mean
- sigma
the standard deviation
- stream
the random number stream
Value Members
-
object
CDF extends Error
The
CDF
object contains methods for computing 'F(x)', the Cumulative Distribution Functions 'CDF's for popular distributions:Uniform
Exponential
Weibel
Empirical
StandardNormal
StudentT
ChiSquare
Fisher
For a given CDF 'F' with argument 'x', compute 'p = F(x)'. -
object
CDFTest_ChiSquare extends App with CDFTest
The
CDFTest_ChiSquare
object is used to test the 'chiSquareCDF' method in theCDF
object.The
CDFTest_ChiSquare
object is used to test the 'chiSquareCDF' method in theCDF
object. > runMain scalation.random.CDFTest_ChiSquare -
object
CDFTest_Empirical extends App
The
CDFTest_Empirical
object is used to test the 'buildEmpiricalCDF' method in theCDF
object.The
CDFTest_Empirical
object is used to test the 'buildEmpiricalCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Empirical -
object
CDFTest_Exponential extends App with CDFTest
The
CDFTest_Exponential
object is used to test the 'ExponentialCDF' method in theCDF
object.The
CDFTest_Exponential
object is used to test the 'ExponentialCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Exponential -
object
CDFTest_Fisher extends App with CDFTest
The
CDFTest_Fisher
object is used to test the 'fisherCDF' method in theCDF
object.The
CDFTest_Fisher
object is used to test the 'fisherCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Fisher -
object
CDFTest_Fisher2 extends App
The
CDFTest_Fisher2
object is used to test the 'fisherCDF' method in theCDF
object.The
CDFTest_Fisher2
object is used to test the 'fisherCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Fisher2 -
object
CDFTest_Normal extends App with CDFTest
The
CDFTest_Normal
object is used to test the 'normalCDF' method in theCDF
object.The
CDFTest_Normal
object is used to test the 'normalCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Normal -
object
CDFTest_Normal_Diff extends App with CDFTest
The
CDFTest_Normal
object is used to test difference between different implementations of the 'normalCDF' method in theCDF
object.The
CDFTest_Normal
object is used to test difference between different implementations of the 'normalCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Normal_Diff -
object
CDFTest_StudentT extends App with CDFTest
The
CDFTest_StudentT
object is used to test the 'studentTCDF' method in theCDF
object.The
CDFTest_StudentT
object is used to test the 'studentTCDF' method in theCDF
object. > runMain scalation.random.CDFTest_StudentT -
object
CDFTest_Uniform extends App with CDFTest
The
CDFTest_Uniform
object is used to test the 'UniformCDF' method in theCDF
object.The
CDFTest_Uniform
object is used to test the 'UniformCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Uniform -
object
CDFTest_Weibull extends App with CDFTest
The
CDFTest_Weibull
object is used to test the 'WeibullCDF' method in theCDF
object.The
CDFTest_Weibull
object is used to test the 'WeibullCDF' method in theCDF
object. > runMain scalation.random.CDFTest_Weibull -
object
CLTTest extends App
The
CLTTest
is used to test theUniform
random variate generator for the illustrating the Central Lmiit Theorem.The
CLTTest
is used to test theUniform
random variate generator for the illustrating the Central Lmiit Theorem. Try adding difference numbers of random values and other distributions. > runMain scalation.random.CLTTest -
object
DiceTest extends App
The
DiceTest
is used to test theRandi
random variate generator for the case of rolling two dice.The
DiceTest
is used to test theRandi
random variate generator for the case of rolling two dice. The probability mass function (pmf) is plotted. > runMain scalation.random.DiceTest -
object
PoissonProcessTest extends App
The
PoissonProcessTest
object is used to test both thePoissonProcess
andNHPoissonProcess
classes. -
object
Quantile extends Error
The
Quantile
object contains methods for computing 'Finv', the "inverse" Cumulative Distribution Functions (iCDF's) for popular sampling distributions:StandardNormal
,StudentT
,ChiSquare
andFisher
.The
Quantile
object contains methods for computing 'Finv', the "inverse" Cumulative Distribution Functions (iCDF's) for popular sampling distributions:StandardNormal
,StudentT
,ChiSquare
andFisher
. For a given CDF 'F' and probability/quantile 'p', compute 'x' such that 'F(x) = p'. The iCDF may be thought of as giving value of 'x' for which the area under the curve from -infinity to 'x' of the probability density function (pdf) is equal to 'p'. -
object
QuantileTest_ChiSquare extends App with QuantileTest
The
QuantileTest_ChiSquare
object is used to test the 'chiSquareInv' method in theQuantile
object.The
QuantileTest_ChiSquare
object is used to test the 'chiSquareInv' method in theQuantile
object. > runMain scalation.random.QuantileTest_ChiSquare -
object
QuantileTest_Empirical extends App with QuantileTest
The
QuantileTest_Empirical
object is used to test the 'empiricalInv' method in theQuantile
object.The
QuantileTest_Empirical
object is used to test the 'empiricalInv' method in theQuantile
object. > runMain scalation.random.QuantileTest_Empirical -
object
QuantileTest_Exponential extends App with QuantileTest
The
QuantileTest_Exponential
object is used to test the 'exponentialInv' method in theQuantile
object.The
QuantileTest_Exponential
object is used to test the 'exponentialInv' method in theQuantile
object. > runMain scalation.random.QuantileTest_Exponential -
object
QuantileTest_Fisher extends App with QuantileTest
The
QuantileTest_Fisher
object is used to test the 'fisherInv' method in theQuantile
object.The
QuantileTest_Fisher
object is used to test the 'fisherInv' method in theQuantile
object. > runMain scalation.random.QuantileTest_Fisher -
object
QuantileTest_Normal extends App with QuantileTest
The
QuantileTest_Normal
object is used to test the 'normalInv' method in theQuantile
object.The
QuantileTest_Normal
object is used to test the 'normalInv' method in theQuantile
object. > runMain scalation.random.QuantileTest_Normal -
object
QuantileTest_StudentT extends App with QuantileTest
The
QuantileTest_StudentT
object is used to test the 'studentTInv' method in theQuantile
object.The
QuantileTest_StudentT
object is used to test the 'studentTInv' method in theQuantile
object. > runMain scalation.random.QuantileTest_StudentT -
object
QuantileTest_Uniform extends App with QuantileTest
The
QuantileTest_Uniform
object is used to test the 'uniformInv' method in theQuantile
object.The
QuantileTest_Uniform
object is used to test the 'uniformInv' method in theQuantile
object. > runMain scalation.random.QuantileTest_Uniform -
object
RNGStream
The
RNGStream
object allows for random selection of streams for applications where reproducibility of random numbers is not desired. -
object
RNGTest extends App with Error
The
RNGTest
object conducts three simple tests of the Random Number Generators: (1) Speed Test, (2) Means Test and (3) Chi-square Goodness of Fit Test.The
RNGTest
object conducts three simple tests of the Random Number Generators: (1) Speed Test, (2) Means Test and (3) Chi-square Goodness of Fit Test. FIX: need to add (3) Variance Test and (4) K-S Goodness of Fit Test. > runMain scalation.random.RNGTest -
object
RandomSeeds
The first 1000 seeds for the 'MRG31k3p' random number generator.
-
object
RandomSeeds3
The first 1000 seeds for the LCG random number generator.
-
object
RandomStrTest extends App
The
RandomStrTest
object is used to test the Random Variate String (RVS) generator from theRandomStr
class.The
RandomStrTest
object is used to test the Random Variate String (RVS) generator from theRandomStr
class. > runMain scalation.random.RandomStrTest -
object
RandomWordTest extends App
The
RandomWordTest
object is used to test the Random Variate Word (RVW) generator from theRandomWord
class.The
RandomWordTest
object is used to test the Random Variate Word (RVW) generator from theRandomWord
class. > runMain scalation.random.RandomWordTest -
object
StreamMaker
The
StreamMaker
object computes seeds forRandom
andRandom2
, both of which implement the 'MRG31k3p' random number generator.The
StreamMaker
object computes seeds forRandom
andRandom2
, both of which implement the 'MRG31k3p' random number generator. This generator has a period length around 2^185. Each seed is a 6-dimensional vector of 32-bit integers.- See also
http://www.iro.umontreal.ca/~simardr/ssj/indexe.html
-
object
StreamMaker3 extends App
The
StreamMaker3
object finds seeds for theRandom3
random number generator.The
StreamMaker3
object finds seeds for theRandom3
random number generator. This generator has a period length around 2^31. Each seed is a 32-bit integer. -
object
StreamMakerGen extends App
The
StreamMakerGen
object generates and prints the first 'k' seeds for the the 'MRG31k3p' random number generator's streams. -
object
VariateMat
The
VariateMat
companion object provides a method to add correlation to a matrix. -
object
VariateMatTest extends App
The
VariateMatTest
object is used to test the Random Variate Matrix (RVM) generators from the classes derived fromVariateMat
.The
VariateMatTest
object is used to test the Random Variate Matrix (RVM) generators from the classes derived fromVariateMat
. > runMain scalation.random.VariateMatTest -
object
VariateSetTest extends App
The
VariateSetTest
object is used to test the Random Variate Set (RVS) generators from the classes derived fromVariateSet
.The
VariateSetTest
object is used to test the Random Variate Set (RVS) generators from the classes derived fromVariateSet
. > runMain scalation.random.VariateSetTest -
object
VariateSetTest2 extends App
The
VariateSetTest2
object is used to test the Random Variate Set (RVS) generators from the classes derived fromVariateSet
.The
VariateSetTest2
object is used to test the Random Variate Set (RVS) generators from the classes derived fromVariateSet
. > runMain scalation.random.VariateSetTest2 -
object
VariateSetTest3 extends App
The
VariateSetTest3
object is used to test the Random Variate Set (RVS) generators from the classes derived fromVariateSet
.The
VariateSetTest3
object is used to test the Random Variate Set (RVS) generators from the classes derived fromVariateSet
. > runMain scalation.random.VariateSetTest3 -
object
VariateTest extends App
The
VariateTest
object conducts two simple tests of the Random Variate Generators: (1) Means Test and (2) Chi-square Goodness of Fit Test.The
VariateTest
object conducts two simple tests of the Random Variate Generators: (1) Means Test and (2) Chi-square Goodness of Fit Test. FIX: need to add (3) Variance Test and (4) K-S Goodness of Fit Test. > runMain scalation.random.VariateTest -
object
VariateVecTest extends App
The
VariateVecTest
object is used to test the Random Variate Vector (RVV) generators from the classes derived fromVariateVec
.The
VariateVecTest
object is used to test the Random Variate Vector (RVV) generators from the classes derived fromVariateVec
. > runMain scalation.random.VariateVecTest