pub struct FastGeneratorInversion<'a> { /* private fields */ }Expand description
Fast numerical inversion of a standard density with a location and a scale (SciPy’s
FastGeneratorInversion, which wraps the library’s distributions and picks the method that
suits each; here the density is given, and the method is polynomial inversion of order 5 at
resolution 1e-12): X = loc + scale · Z, Z with the given density.
Implementations§
Source§impl<'a> FastGeneratorInversion<'a>
impl<'a> FastGeneratorInversion<'a>
pub fn new( pdf: impl Fn(f64) -> f64 + 'a, domain: (f64, f64), center: f64, loc: f64, scale: f64, ) -> Result<Self, ErrorsJSL>
pub fn ppf(&self, u: f64) -> f64
pub fn cdf(&self, x: f64) -> f64
pub fn rvs<G: UniformGenerator>(&self, n: usize, rng: &mut G) -> Vec<f64>
pub fn qrvs_sobol(&self, n: usize) -> Vec<f64>
pub fn u_error(&self, n: usize) -> f64
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for FastGeneratorInversion<'a>
impl<'a> !Send for FastGeneratorInversion<'a>
impl<'a> !Sync for FastGeneratorInversion<'a>
impl<'a> !UnwindSafe for FastGeneratorInversion<'a>
impl<'a> Freeze for FastGeneratorInversion<'a>
impl<'a> Unpin for FastGeneratorInversion<'a>
impl<'a> UnsafeUnpin for FastGeneratorInversion<'a>
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