Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cl-random Reference Manual, version 0.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 12:43:00 2020 GMT+0.
• Introduction | What cl-random is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
This library is unsupported.
cl-random is a library for (1) generating random draws from various commonly used distributions, and (2) calculating statistical functions, such as density, distribution and quantiles for these distributions.
In the implementation and the interface, our primary considerations were
Correctness. Above everything, all calculations should be correct. Correctness shall not be sacrificed for speed or implementational simplicity. Consequently, everything should be unit-tested all the time.
Simple and unified interface. Random variables are instances which can be used for calculations and random draws, for example,
(let ((rv (r-normal 13 2)))
(pdf rv 15d0) ; density
(cdf rv 13d0) ; CDF
(draw rv)) ; a random draw
Implementation note: Subclasses are allowed to calculate intermediate values (eg to speed up computation) any time, eg right after the initialization of the instance, or on demand. The consequences or changing the slots of RV classes are UNDEFINED, but probably quite nasty. Don't do it. Note: lazy slots are currently not used, will be reintroduced in the future after some serious profiling/benchmarking.
Sketch the interface.
Some basic functionality. We are currently here, eg exponential, normal and gamma distributions are partially implemented.
Keep extending the library based on user demand.
Optimize things on demand, see where the bottlenecks are.
more serious testing. I like the approach in Cook (2006): we should transform empirical quantiles to z-statistics and calculate the p-value using chi-square tests
(mm rv x) and similar methods for multivariate normal (and maybe T)
Always try to implement state-of-the-art generation and calculation methods. If you need something, read up on the literature, the field has developed a lot in the last decades, and most older books present obsolete methods. Good starting points are Gentle (2005) and Press et al (2007), though you should use the latter one with care and don't copy algorithms without reading a few recent articles, they are not always the best ones (the authors admit this, but they claim that some algorithms are there for pedagogical purposes).
Always document the references in the docstring, and include the full citation in doc/references.bib (BibTeX format).
Do at least basic optimization with declarations (eg until SBCL doesn't give a notes any more, notes about return values are OK). Benchmarks are always welcome, and should be documented.
Document doubts and suggestions for improvements, use !!
and ??
, more
marks mean higher priority.
The naming convention for building blocks is something like
(draw|cdf|pdf|quantile|...)-(standard-)?distribution-name(possible-suffix)?
,
eg pdf-standard-normal
or draw-standard-gamma1
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cl-random system |
Tamas K Papp
MIT
Random numbers and distributions.
0.0.1
cl-random.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
Next: The cl-random/internals․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
/home/quickref/quicklisp/dists/quicklisp/software/cl-random-20180328-git/cl-random.asd
cl-random (system)
Next: The cl-random/package․lisp file, Previous: The cl-random․asd file, Up: Lisp files [Contents][Index]
cl-random (system)
internals.lisp
Next: The cl-random/generator․lisp file, Previous: The cl-random/internals․lisp file, Up: Lisp files [Contents][Index]
internals.lisp (file)
cl-random (system)
package.lisp
Next: The cl-random/simple-multiplicative-congruential-generators․lisp file, Previous: The cl-random/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
cl-random (system)
generator.lisp
Next: The cl-random/random․lisp file, Previous: The cl-random/generator․lisp file, Up: Lisp files [Contents][Index]
generator.lisp (file)
cl-random (system)
simple-multiplicative-congruential-generators.lisp
Next: The cl-random/discrete․lisp file, Previous: The cl-random/simple-multiplicative-congruential-generators․lisp file, Up: Lisp files [Contents][Index]
cl-random (system)
random.lisp
Next: The cl-random/univariate․lisp file, Previous: The cl-random/random․lisp file, Up: Lisp files [Contents][Index]
random.lisp (file)
cl-random (system)
discrete.lisp
Next: The cl-random/continuous-time․lisp file, Previous: The cl-random/discrete․lisp file, Up: Lisp files [Contents][Index]
discrete.lisp (file)
cl-random (system)
univariate.lisp
Previous: The cl-random/univariate․lisp file, Up: Lisp files [Contents][Index]
univariate.lisp (file)
cl-random (system)
continuous-time.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cl-random.internals package | ||
• The cl-random package |
Next: The cl-random package, Previous: Packages, Up: Packages [Contents][Index]
internals.lisp (file)
Previous: The cl-random․internals package, Up: Packages [Contents][Index]
package.lisp (file)
rv
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported macros | ||
• Exported functions | ||
• Exported generic functions | ||
• Exported structures | ||
• Exported classes | ||
• Exported types |
Next: Exported functions, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Handle a constant that is calculated only when IGNORE-CONSTANT? is NIL and VALUE is not negative infinity (represented by NIL).
internals.lisp (file)
Evaluate bindings (expanding into LET+, so all features can be used) until condition is satisfied, then return value.
internals.lisp (file)
Rebind each variable, coerced to a the internal float type used by CL-RANDOM.
internals.lisp (file)
Next: Exported generic functions, Previous: Exported macros, Up: Exported definitions [Contents][Index]
Return the argument coerced to the CL-RANDOM library’s internal float type.
internals.lisp (file)
Normalize vector as probabilities, assert that all are positive, return them as a VECTOR-DOUBLE-FLOAT. Vector is always copied.
internals.lisp (file)
Return VECTOR converted to another vector with elements converted to INTERNAL-FLOAT if necessary. When COPY?, the vector is always copied.
internals.lisp (file)
Return a vector of COUNT distinct random integers, in increasing order, drawn from the uniform discrete distribution on {0 , ..., limit-1}.
discrete.lisp (file)
Implementation of DISTINCT-RANDOM-INTEGERS when count/limit is (relatively) high. Implements algorithm S from @cite{taocp3}, p 142.
discrete.lisp (file)
Return T with probability p, otherwise NIL. Rationals are handled exactly.
univariate.lisp (file)
Return the number of successes out of N Bernoulli trials with probability of success P.
univariate.lisp (file)
Return a random variable from the Exponential(rate) distribution which has density rate*exp(-rate*x) for x>=0 and 0 for x<0. rate > 0.
univariate.lisp (file)
Return the number of Bernoulli trials, with probability of success P, that were needed to reach the first success. This is >= 1.
univariate.lisp (file)
Return the number of events that occur with probability LAMDA. The algorithm is from Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer Programming, Volume 2. Addison Wesley. WARNING: It’s simple but only linear in the return value K and is numerically unstable for large LAMDA.
univariate.lisp (file)
Return a random variable from the Rayleigh(scale) distribution, where scale > 0 and density x * exp(-x^2 / (2 scale^2)) / scale^2 for x>=0 and 0 for x<0.
univariate.lisp (file)
Return a random variable from the Exponential(1) distribution, which has density exp(-x) for x>=0 and 0 for x<0.
univariate.lisp (file)
Draw a random number from N(0,1).
univariate.lisp (file)
Draw a standard T random variate, with NU degrees of freedom.
univariate.lisp (file)
Return a random variable from the uniform distribution between LEFT and RIGHT. It’s type is the same as that of (- LEFT RIGHT).
univariate.lisp (file)
Scale x from standard normal.
univariate.lisp (file)
Make a random number generator object. SEED can be any of NIL, T, an other generator,
an integer, or any type of seed that a generator of type TYPE supports:
- NIL: the generator’s STD-SEED is used;
- T: a random seed is used;
- a generator: a clone is returned;
- otherwise: SEED is used as depends on the generator.
generator.lisp (file)
Generates a uniformly distributed pseudo-random number greater than or equal to zero and less than LIMIT. RNG, if supplied, is the random generator to use.
generator.lisp (file)
Probability distribution function of RANDOM-VARIABLE at X. See LOG-PDF for the semantics of IGNORE-CONSTANT?.
random.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Chi-square distribution with NU degrees of freedom.
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Generalized inverse chi-square distribution. Reparametrized to INVERSE-GAMMA.
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Truncated normal distribution. If LEFT or RIGHT is NIL, it corresponds to -/+ infinity.
univariate.lisp (file)
univariate.lisp (file)
continuous-time.lisp (file)
Return the coefficient that multiplies the Sigma matrix or the squared scale to get the variance of a (multivariate) Student-T distribution. Also checks that nu > 2, ie the variance is defined.
univariate.lisp (file)
Scale x to standard normal.
univariate.lisp (file)
Next: Exported structures, Previous: Exported functions, Up: Exported definitions [Contents][Index]
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Cumulative distribution function of RANDOM-VARIABLE at X.
random.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Draw random variates. Can also be used on generators.
random.lisp (file)
continuous-time.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Return a closure that returns random draws.
random.lisp (file)
univariate.lisp (file)
Log of probability distribution function of RANDOM-VARIABLE at X. NIL corresponds to log(-infinity). When IGNORE-CONSTANT?, the result may be shifted by an arbitrary real constant that does not change between calls of the same RANDOM-VARIABLE. This may save computation, and is useful for MCMC methods, etc.
random.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Mean of random variable.
random.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Return the degrees of freedom when applicable.
univariate.lisp (file)
univariate.lisp (file)
Quantile of RANDOM-VARIABLE at Q.
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Standard deviation of random variable.
univariate.lisp (file)
Variance of random variable.
random.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Next: Exported classes, Previous: Exported generic functions, Up: Exported definitions [Contents][Index]
Bernoulli(pr) distribution, with probability PR for success and 1-PR for failure.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-bernoulli-pr (function)
(setf r-bernoulli-pr) (function)
Beta(alpha,beta) distribution, with density proportional to x^(alpha-1)*(1-x)^(beta-1).
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-beta-alpha (function)
(setf r-beta-alpha) (function)
cl-random.internals:internal-float
r-beta-beta (function)
(setf r-beta-beta) (function)
Binomial(pr,n) distribution, with N Bernoulli trials with probability PR for success.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-binomial-pr (function)
(setf r-binomial-pr) (function)
integer
r-binomial-n (function)
(setf r-binomial-n) (function)
Discrete probabilities.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:float-vector
r-discrete-probabilities (function)
(setf r-discrete-probabilities) (function)
cl-random.internals:float-vector
r-discrete-prob (function)
(setf r-discrete-prob) (function)
(simple-array fixnum (*))
r-discrete-alias (function)
(setf r-discrete-alias) (function)
cl-random.internals:internal-float
r-discrete-n-float (function)
(setf r-discrete-n-float) (function)
Exponential(rate) distribution, with density rate*exp(-rate*x) for x>=0 and 0 for x<0. rate > 0.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-exponential-rate (function)
(setf r-exponential-rate) (function)
Gamma(alpha,beta) distribution, with density proportional to x^(alpha-1) exp(-x*beta). Alpha and beta are known as shape and inverse scale (or rate) parameters, respectively.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-gamma-alpha (function)
(setf r-gamma-alpha) (function)
cl-random.internals:internal-float
r-gamma-beta (function)
(setf r-gamma-beta) (function)
Geometric(pr) distribution.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-geometric-pr (function)
(setf r-geometric-pr) (function)
Inverse-Gamma(alpha,beta) distribution, with density p(x) proportional to x^(-alpha+1) exp(-beta/x)
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-inverse-gamma-alpha (function)
(setf r-inverse-gamma-alpha) (function)
cl-random.internals:internal-float
r-inverse-gamma-beta (function)
(setf r-inverse-gamma-beta) (function)
Log-normal distribution with location log-mean and scale log-sd.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-log-normal-log-mean (function)
(setf r-log-normal-log-mean) (function)
cl-random.internals:internal-float
r-log-normal-log-sd (function)
(setf r-log-normal-log-sd) (function)
Normal(mean,variance) distribution.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-normal-mean (function)
(setf r-normal-mean) (function)
cl-random.internals:internal-float
r-normal-sd (function)
(setf r-normal-sd) (function)
Rayleigh(scale) distribution with scale > 0 and density x * exp(-x^2 / (2 scale^2)) / scale^2 for x>=0 and 0 for x<0.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-rayleigh-scale (function)
(setf r-rayleigh-scale) (function)
T(mean,scale,nu) random variate.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-t-mean (function)
(setf r-t-mean) (function)
cl-random.internals:internal-float
r-t-scale (function)
(setf r-t-scale) (function)
cl-random.internals:internal-float
r-t-nu (function)
(setf r-t-nu) (function)
Uniform(left,right) distribution.
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
r-uniform-left (function)
(setf r-uniform-left) (function)
cl-random.internals:internal-float
r-uniform-right (function)
(setf r-uniform-right) (function)
cl-random.internals:internal-float
r-uniform-width (function)
(setf r-uniform-width) (function)
Define a random variable for uniformized markov jumps,
which returns two values: the time spent in the state, and the index of the
next state (or the corresponding element in KEYS, which is a vector of the
same length). TRANSITION-RATES defaults to the sum of keys, however, it can
be specified to be larger, in which case the markov chain may remain in the
same state and return NO-CHANGE as the second value. Defines features
DURATION and JUMP, which return the two underlying random variables.
continuous-time.lisp (file)
structure-object (structure)
r-uniformized-markov-jump-duration (function)
(setf r-uniformized-markov-jump-duration) (function)
r-uniformized-markov-jump-jump (function)
(setf r-uniformized-markov-jump-jump) (function)
r-uniformized-markov-jump-no-change (function)
(setf r-uniformized-markov-jump-no-change) (function)
fixnum
r-uniformized-markov-jump-n (function)
(setf r-uniformized-markov-jump-n) (function)
(or null vector)
r-uniformized-markov-jump-keys (function)
(setf r-uniformized-markov-jump-keys) (function)
Next: Exported types, Previous: Exported structures, Up: Exported definitions [Contents][Index]
Donald E. Knuth’s Borosh-Niederreiter, The Art of Computer Programming, Volume 2, Third Edition, Addison-Wesley, pp 106-108.
1812433253
32
Base class for random number generators.
generator.lisp (file)
standard-object (class)
All information needed by the generator to create the next chunk
of random bits. This state is modified after each call to NEXT-CHUNK.
:state
state (generic function)
(setf state) (generic function)
The minimum value return by NEXT-CHUNK.
:min
The maximum value return by NEXT-CHUNK.
:max
The length in bits of the integer returned by NEXT-CHUNK.
chunk-length (generic function)
The seed used by default, when the seed is NIL.
0
default-seed (generic function)
The poor IBM randu generator. Park and Miller, Random Number
Generators: Good ones are hard to find, Communications of the ACM, October 1988, Volume
31, No 10, pp 1192-1201.
65539
31
INMOS Transputer Development System generator.
1664525
32
Donald E. Knuth’s Waterman, The Art of Computer Programming, Volume 2, Third Edition, Addison-Wesley, pp 106-108.
1566083941
32
Previous: Exported classes, Up: Exported definitions [Contents][Index]
internals.lisp (file)
Type used for internal representation of floats in the CL-RANDOM library.
internals.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal constants | ||
• Internal special variables | ||
• Internal macros | ||
• Internal functions | ||
• Internal generic functions | ||
• Internal structures | ||
• Internal classes |
Next: Internal special variables, Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Normalizing constant for a standard normal PDF.
univariate.lisp (file)
Next: Internal macros, Previous: Internal constants, Up: Internal definitions [Contents][Index]
generator.lisp (file)
Next: Internal functions, Previous: Internal special variables, Up: Internal definitions [Contents][Index]
Define a random variable, abstracting from the representation. Syntax:
NAME is a symbol, and will name the class and the creation function.
CONSTRUCTOR-LAMBDA-LIST will be used to wrap the CONSTRUCTOR-FORM, which can use the locally define macro (MAKE :slot-name value1 ...) to initialize slots.
SLOTS is a list of (slot-name &key type read-only reader) slot specifications. When READER is T, SLOT-NAME is used instead, otherwise a method is defined using the given symbol.
OPTIONS is (&key documentation instance), the default instance is a gensym.
METHODS are (function-name lambda-list &body body), with (INSTANCE NAME) prepended to the lambda-list, ie the instance is accessible using INSTANCE. Also, within BODY, slots are accessible by their names.
random.lisp (file)
Next: Internal generic functions, Previous: Internal macros, Up: Internal definitions [Contents][Index]
Handle the single or double float case of RANDOM. We generate a float in [0d0, 1d0) by clobbering the mantissa of 1d0 with random bits (52 bits); this yields a number in [1d0, 2d0). Then 1d0 is subtracted.
generator.lisp (file)
Generates an integer greater than or equal to zero and less than LIMIT. Successive chunks are concatenated without overlap to construct integers larger than a single chunk. The return value has this property: If two integers are generated from the same RNG with LIMIT equal to 2^m and 2^n, respectively, then bit k is the same in both integers for 0 <= k < min(m,n). Each call to %NEXT-INTEGER consumes at least one chunk; bits left over from previous chunks are not re-used.
generator.lisp (file)
Handle the single or double float case of RANDOM. We generate a float in [0f0, 1f0) by clobbering the mantissa of 1f0 with random bits (23 bits); this yields a number in [1f0, 2f0). Then 1f0 is subtracted.
generator.lisp (file)
Internal function for normal CDF.
univariate.lisp (file)
Assert that P is a probability (ie a real number between 0 and 1). When OPEN is given, it is checked that p is not 0 (:LEFT), 1 (:RIGHT), or 0/1 (:BOTH).
random.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
continuous-time.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Draw a left truncated standard normal, using an Exp(alpha,left) distribution. LEFT is the standardized boundary, ALPHA should be calculated with TRUNCATED-NORMAL-OPTIMAL-ALPHA.
univariate.lisp (file)
Return a standard gamma variate (beta=1) with shape parameter alpha >= 1. See Marsaglia and Tsang (2004). You should precalculate d and c using the utility function above.
univariate.lisp (file)
Return a 64-bit random seed, based on current time.
generator.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Log gamma function.
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
continuous-time.lisp (file)
univariate.lisp (file)
Internal function for normal quantile.
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
continuous-time.lisp (file)
continuous-time.lisp (file)
continuous-time.lisp (file)
continuous-time.lisp (file)
continuous-time.lisp (file)
continuous-time.lisp (file)
univariate.lisp (file)
Return precalculated constants (values d c), useful for drawing from a gamma distribution.
univariate.lisp (file)
N=0 gives the total mass of the truncated normal, used for normalization,
N=1 the mean, and N=2 the variance. where p(x) is the normal density. When LEFT or RIGHT are NIL, they are taken to be - or + infinity, respectively. M0 may be provided for efficiency if would be calculated multiple times. The formulas are from Jawitz (2004).
univariate.lisp (file)
Calculate optimal exponential parameter for left-truncated normals. LEFT is the standardized boundary.
univariate.lisp (file)
Next: Internal structures, Previous: Internal functions, Up: Internal definitions [Contents][Index]
The multiplier of the sequence x(n+1) = A * x(n) mod M.
The length in bits of the integer returned by NEXT-CHUNK.
generator.lisp (file)
The seed used by default, when the seed is NIL.
generator.lisp (file)
continuous-time.lisp (file)
Return a state for a generator of RNG’s type using seed.
generator.lisp (file)
continuous-time.lisp (file)
The modulo of the sequence x(n+1) = A * x(n) mod M.
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
univariate.lisp (file)
Return the scale when applicable.
univariate.lisp (file)
univariate.lisp (file)
All information needed by the generator to create the next chunk
of random bits. This state is modified after each call to NEXT-CHUNK.
generator.lisp (file)
Next: Internal classes, Previous: Internal generic functions, Up: Internal definitions [Contents][Index]
Truncated normal distribution with given mu and sigma (corresponds to the mean and standard deviation in the untruncated case, respectively), on the interval [left, infinity).
univariate.lisp (file)
r-univariate (structure)
cl-random.internals:internal-float
left-truncated-normal-mu (function)
(setf left-truncated-normal-mu) (function)
cl-random.internals:internal-float
left-truncated-normal-sigma (function)
(setf left-truncated-normal-sigma) (function)
cl-random.internals:internal-float
left-truncated-normal-left (function)
(setf left-truncated-normal-left) (function)
cl-random.internals:internal-float
left-truncated-normal-left-standardized (function)
cl-random.internals:internal-float
left-truncated-normal-m0 (function)
(setf left-truncated-normal-m0) (function)
cl-random.internals:internal-float
left-truncated-normal-alpha (function)
(setf left-truncated-normal-alpha) (function)
Univariate distribution.
univariate.lisp (file)
structure-object (structure)
standard-deviation (method)
Previous: Internal structures, Up: Internal definitions [Contents][Index]
A multiplicative congruential generator generates the sequence x(n+1) =
A * x(n) mod M and uses the seed as x(1). A simple multiplicative congruential generator
is a multiplicative congruential generator with M a power of 2. This allows to implement
the modulo operation as a bitwise and operation of M-1, which is also the maximum value
of a random chunk.
generator (class)
1
The multiplier of the sequence x(n+1) = A * x(n) mod M.
a (generic function)
The modulo of the sequence x(n+1) = A * x(n) mod M.
m (generic function)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | %
(
A B C D F G J L M N P Q R S T V W |
---|
Jump to: | %
(
A B C D F G J L M N P Q R S T V W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
+
A B C D J K L M N P R S W |
---|
Jump to: | *
+
A B C D J K L M N P R S W |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | B C F G I L P R S T W |
---|
Jump to: | B C F G I L P R S T W |
---|