pub enum VarianceReduction {
None,
Antithetic,
Stratified {
strata: usize,
},
LatinHypercube {
samples: usize,
},
}Expand description
Variance reduction technique configuration
Variants§
None
No variance reduction (baseline)
Antithetic
Antithetic variates for symmetric distributions
For each uniform U, also use (1-U), creating negatively correlated pairs. Reduces variance when the function is monotonic.
Stratified
Stratified sampling with K strata
Partitions [0,1] into K equal intervals and samples from each.
Guarantees representation across the entire range.
LatinHypercube
Latin Hypercube Sampling
Ensures each dimension is sampled uniformly across its range. Better coverage than simple random sampling.
Implementations§
Source§impl VarianceReduction
impl VarianceReduction
Sourcepub fn generate_uniforms(&self, n: usize, rng: &mut MonteCarloRng) -> Vec<f64>
pub fn generate_uniforms(&self, n: usize, rng: &mut MonteCarloRng) -> Vec<f64>
Generate uniforms with variance reduction applied
Sourcepub fn generate_normals(&self, n: usize, rng: &mut MonteCarloRng) -> Vec<f64>
pub fn generate_normals(&self, n: usize, rng: &mut MonteCarloRng) -> Vec<f64>
Generate standard normal samples with variance reduction
Sourcepub fn estimate_variance_ratio(&self) -> f64
pub fn estimate_variance_ratio(&self) -> f64
Estimate variance reduction factor compared to simple sampling
Returns ratio of variance with technique vs without (< 1 means reduction)
Trait Implementations§
Source§impl Clone for VarianceReduction
impl Clone for VarianceReduction
Source§fn clone(&self) -> VarianceReduction
fn clone(&self) -> VarianceReduction
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 VarianceReduction
impl Debug for VarianceReduction
Source§impl Default for VarianceReduction
impl Default for VarianceReduction
Source§fn default() -> VarianceReduction
fn default() -> VarianceReduction
Auto Trait Implementations§
impl Forget for VarianceReduction
impl Freeze for VarianceReduction
impl Move for VarianceReduction
impl RefUnwindSafe for VarianceReduction
impl Send for VarianceReduction
impl Sync for VarianceReduction
impl Unpin for VarianceReduction
impl UnsafeUnpin for VarianceReduction
impl UnwindSafe for VarianceReduction
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more