pub struct ZeroInflatedConfig {
pub zero_probability: f64,
pub base_distribution: ZeroInflatedBaseDistribution,
pub lognormal_mu: f64,
pub lognormal_sigma: f64,
pub exponential_lambda: f64,
pub poisson_lambda: f64,
pub min_value: f64,
pub max_value: Option<f64>,
pub decimal_places: u8,
}Expand description
Configuration for zero-inflated distribution.
Fields§
§zero_probability: f64Probability of a structural zero (0.0-1.0). Higher values = more zeros.
base_distribution: ZeroInflatedBaseDistributionType of base distribution for non-zero values.
lognormal_mu: f64Mu parameter for log-normal base distribution.
lognormal_sigma: f64Sigma parameter for log-normal base distribution.
exponential_lambda: f64Lambda parameter for exponential base distribution.
poisson_lambda: f64Lambda parameter for Poisson base distribution.
min_value: f64Minimum non-zero value.
max_value: Option<f64>Maximum value (clamps output).
decimal_places: u8Number of decimal places for rounding.
Implementations§
Source§impl ZeroInflatedConfig
impl ZeroInflatedConfig
Sourcepub fn lognormal(zero_probability: f64, mu: f64, sigma: f64) -> Self
pub fn lognormal(zero_probability: f64, mu: f64, sigma: f64) -> Self
Create a new zero-inflated configuration with log-normal base.
Sourcepub fn exponential(zero_probability: f64, lambda: f64) -> Self
pub fn exponential(zero_probability: f64, lambda: f64) -> Self
Create a new zero-inflated configuration with exponential base.
Sourcepub fn poisson(zero_probability: f64, lambda: f64) -> Self
pub fn poisson(zero_probability: f64, lambda: f64) -> Self
Create a new zero-inflated configuration with Poisson base.
Sourcepub fn credit_memos() -> Self
pub fn credit_memos() -> Self
Create a configuration for credit memos/returns.
Sourcepub fn warranty_claims() -> Self
pub fn warranty_claims() -> Self
Create a configuration for warranty claims.
Sourcepub fn late_penalties() -> Self
pub fn late_penalties() -> Self
Create a configuration for late payment penalties.
Sourcepub fn adjustment_count() -> Self
pub fn adjustment_count() -> Self
Create a configuration for adjustment entries (count-based).
Sourcepub fn return_processing_time() -> Self
pub fn return_processing_time() -> Self
Create a configuration for returns processing time.
Sourcepub fn expected_value(&self) -> f64
pub fn expected_value(&self) -> f64
Get the expected value (mean) including zeros.
Sourcepub fn non_zero_probability(&self) -> f64
pub fn non_zero_probability(&self) -> f64
Get the probability of non-zero value.
Trait Implementations§
Source§impl Clone for ZeroInflatedConfig
impl Clone for ZeroInflatedConfig
Source§fn clone(&self) -> ZeroInflatedConfig
fn clone(&self) -> ZeroInflatedConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ZeroInflatedConfig
impl Debug for ZeroInflatedConfig
Source§impl Default for ZeroInflatedConfig
impl Default for ZeroInflatedConfig
Source§impl<'de> Deserialize<'de> for ZeroInflatedConfig
impl<'de> Deserialize<'de> for ZeroInflatedConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ZeroInflatedConfig
impl RefUnwindSafe for ZeroInflatedConfig
impl Send for ZeroInflatedConfig
impl Sync for ZeroInflatedConfig
impl Unpin for ZeroInflatedConfig
impl UnsafeUnpin for ZeroInflatedConfig
impl UnwindSafe for ZeroInflatedConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.