Skip to main content

FastGeneratorInversion

Struct FastGeneratorInversion 

Source
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>

Source

pub fn new( pdf: impl Fn(f64) -> f64 + 'a, domain: (f64, f64), center: f64, loc: f64, scale: f64, ) -> Result<Self, ErrorsJSL>

Source

pub fn support(&self) -> (f64, f64)

The support of X.

Source

pub fn ppf(&self, u: f64) -> f64

Source

pub fn cdf(&self, x: f64) -> f64

Source

pub fn rvs<G: UniformGenerator>(&self, n: usize, rng: &mut G) -> Vec<f64>

Source

pub fn qrvs_sobol(&self, n: usize) -> Vec<f64>

Source

pub fn u_error(&self, n: usize) -> f64

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.