pub struct LogNormalMixtureSampler { /* private fields */ }Expand description
Log-Normal Mixture Model sampler for positive-only distributions.
Implementations§
Source§impl LogNormalMixtureSampler
impl LogNormalMixtureSampler
Sourcepub fn new(seed: u64, config: LogNormalMixtureConfig) -> Result<Self, String>
pub fn new(seed: u64, config: LogNormalMixtureConfig) -> Result<Self, String>
Create a new Log-Normal mixture sampler.
Sourcepub fn sample_decimal(&mut self) -> Decimal
pub fn sample_decimal(&mut self) -> Decimal
Sample a value as Decimal.
Sourcepub fn sample_with_component(&mut self) -> SampleWithComponent
pub fn sample_with_component(&mut self) -> SampleWithComponent
Sample a value with component information.
Sourcepub fn sample_n_decimal(&mut self, n: usize) -> Vec<Decimal>
pub fn sample_n_decimal(&mut self, n: usize) -> Vec<Decimal>
Sample multiple values as Decimals.
Sourcepub fn config(&self) -> &LogNormalMixtureConfig
pub fn config(&self) -> &LogNormalMixtureConfig
Get the configuration.
Sourcepub fn expected_value(&self) -> f64
pub fn expected_value(&self) -> f64
Get the expected value of the mixture.
Auto Trait Implementations§
impl Freeze for LogNormalMixtureSampler
impl RefUnwindSafe for LogNormalMixtureSampler
impl Send for LogNormalMixtureSampler
impl Sync for LogNormalMixtureSampler
impl Unpin for LogNormalMixtureSampler
impl UnwindSafe for LogNormalMixtureSampler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more