Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard

Distribution sampler that uses the Alias method. It can be used to sample from n values each with an associated probability. This implementation is based on the detailed explanation of the alias method by Keith Schartz and implements Vose's algorithm.

Link copied to clipboard
class BasicSampler<out T : Any>(val chainBuilder: (RandomGenerator) -> Chain<T>) : Sampler<T>

Implements Sampler by delegating sampling to value of chainBuilder.

Link copied to clipboard
Link copied to clipboard

Box-Muller algorithm for sampling from a Gaussian distribution.

Link copied to clipboard
class ConstantSampler<out T : Any>(val value: T) : Sampler<T>

Implements Sampler by sampling only certain value.

Link copied to clipboard
class GaussianSampler(val mean: Double, val standardDeviation: Double, normalized: NormalizedGaussianSampler = BoxMullerSampler) : BlockingDoubleSampler

Sampling from a Gaussian distribution with given mean and standard deviation.

Link copied to clipboard

Sampler for the Poisson distribution.

Link copied to clipboard

Sampler for the Poisson distribution.

Link copied to clipboard

Marsaglia polar method for sampling from a Gaussian distribution with mean 0 and standard deviation 1. This is a variation of the algorithm implemented in BoxMullerNormalizedGaussianSampler.

Link copied to clipboard

Marker interface for a sampler that generates values from an N(0,1) Gaussian distribution.

Link copied to clipboard
class SamplerSpace<T : Any, out S : Group<T>, ScaleOperations<T>>(val algebra: S) : Group<Sampler<T>> , ScaleOperations<Sampler<T>>

A space of samplers. Allows performing simple operations on distributions.

Link copied to clipboard

Sampler for the Poisson distribution.

Link copied to clipboard

Marsaglia and Tsang "Ziggurat" method for sampling from a Gaussian distribution with mean 0 and standard deviation 1. The algorithm is explained in this paper and this implementation has been adapted from the C code provided therein.

Functions

Link copied to clipboard

Sampler for the Poisson distribution.