LargeMeanPoissonSampler

Sampler for the Poisson distribution.

  • For large means, we use the rejection algorithm described in Devroye, Luc. (1981).The Computer Generation of Poisson Random Variables Computing vol. 26 pp. 197-207.

This sampler is suitable for mean >= 40.

Based on Commons RNG implementation. See https://commons.apache.org/proper/commons-rng/commons-rng-sampling/apidocs/org/apache/commons/rng/sampling/distribution/LargeMeanPoissonSampler.html.

Constructors

Link copied to clipboard
constructor(mean: Double)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
suspend fun <T : Any> Sampler<T>.next(generator: RandomGenerator): T

Samples one value from this Sampler.

Link copied to clipboard
suspend fun Sampler<Double>.nextBuffer(generator: RandomGenerator, size: Int): Buffer<Double>

Samples a Buffer of values from this Sampler.

Link copied to clipboard
open override fun sample(generator: RandomGenerator): BlockingIntChain

Generates a chain of samples.

Link copied to clipboard
@JvmName(name = "sampleRealBuffer")
fun Sampler<Double>.sampleBuffer(generator: RandomGenerator, size: Int): Chain<Buffer<Double>>

Generates size real samples and chunks them into some buffers.

@JvmName(name = "sampleIntBuffer")
fun Sampler<Int>.sampleBuffer(generator: RandomGenerator, size: Int): Chain<Buffer<Int>>

Generates size integer samples and chunks them into some buffers.

fun <T : Any> Sampler<T>.sampleBuffer(generator: RandomGenerator, size: Int, bufferFactory: BufferFactory<T> = BufferFactory.boxing()): Chain<Buffer<T>>

Sample a bunch of values

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard