public final class MarsagliaTsangWangDiscreteSampler extends java.lang.Object
Sampling uses 1 call to UniformRandomProvider.nextInt().
Memory requirements depend on the maximum number of possible sample values, n,
and the values for the probabilities. Storage is optimised for n. The worst case
scenario is a uniform distribution of the maximum sample size. This is capped at 0.06MB for
n <= 28, 17.0MB for n <= 216, and 4.3GB for
n <= 230. Realistic requirements will be in the kB range.
The sampler supports the following distributions:
mean = 1024
trials = 65535
| Modifier and Type | Class | Description |
|---|---|---|
static class |
MarsagliaTsangWangDiscreteSampler.Binomial |
Create a sampler for the Binomial distribution.
|
static class |
MarsagliaTsangWangDiscreteSampler.Enumerated |
Create a sampler for an enumerated distribution of
n values each with an
associated probability. |
static class |
MarsagliaTsangWangDiscreteSampler.Poisson |
Create a sampler for the Poisson distribution.
|
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.