pub enum AdvancedAmountSampler {
LogNormal(LogNormalMixtureSampler),
Gaussian(GaussianMixtureSampler),
Pareto(ParetoSampler),
}Expand description
Advanced amount sampler wrapping one of the supported distribution
families. Callers keep their existing legacy [AmountSampler](super::
AmountSampler) and only consult this wrapper when
distributions.amounts.enabled (or another advanced sub-block like
distributions.pareto.enabled) is true.
v3.4.4 added the Pareto variant for heavy-tailed monetary samples
(capex, strategic contracts, fraud amounts).
Variants§
LogNormal(LogNormalMixtureSampler)
Log-normal mixture (preferred for positive monetary amounts).
Gaussian(GaussianMixtureSampler)
Gaussian mixture (useful for signed quantities like deltas).
Pareto(ParetoSampler)
Pareto heavy-tailed distribution (v3.4.4+).
Implementations§
Source§impl AdvancedAmountSampler
impl AdvancedAmountSampler
Sourcepub fn new_log_normal(
seed: u64,
config: LogNormalMixtureConfig,
) -> Result<Self, String>
pub fn new_log_normal( seed: u64, config: LogNormalMixtureConfig, ) -> Result<Self, String>
Create a log-normal-mixture sampler.
Sourcepub fn new_gaussian(
seed: u64,
config: GaussianMixtureConfig,
) -> Result<Self, String>
pub fn new_gaussian( seed: u64, config: GaussianMixtureConfig, ) -> Result<Self, String>
Create a Gaussian-mixture sampler.
Sourcepub fn new_pareto(seed: u64, config: ParetoConfig) -> Result<Self, String>
pub fn new_pareto(seed: u64, config: ParetoConfig) -> Result<Self, String>
Create a Pareto sampler (v3.4.4+).
Sourcepub fn sample_decimal(&mut self) -> Decimal
pub fn sample_decimal(&mut self) -> Decimal
Sample one amount as Decimal.
Sourcepub fn ppf_decimal(&self, u: f64) -> Decimal
pub fn ppf_decimal(&self, u: f64) -> Decimal
v4.1.6+ inverse CDF (quantile function) — returns the Decimal
quantile at uniform u ∈ (0, 1) for whichever underlying
sampler is active. Gaussian variant clamps negatives to zero
(monetary-amount semantics).
Trait Implementations§
Source§impl Clone for AdvancedAmountSampler
impl Clone for AdvancedAmountSampler
Source§fn clone(&self) -> AdvancedAmountSampler
fn clone(&self) -> AdvancedAmountSampler
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more