pub struct Cauchy { /* private fields */ }
Expand description
Implementations§
Source§impl Cauchy
impl Cauchy
Sourcepub fn new(location: f64, scale: f64) -> Result<Cauchy, CauchyError>
pub fn new(location: f64, scale: f64) -> Result<Cauchy, CauchyError>
Constructs a new cauchy distribution with the given location and scale.
§Errors
Returns an error if location or scale are NaN
or scale <= 0.0
§Examples
use statrs::distribution::Cauchy;
let mut result = Cauchy::new(0.0, 1.0);
assert!(result.is_ok());
result = Cauchy::new(0.0, -1.0);
assert!(result.is_err());
Trait Implementations§
Source§impl Continuous<f64, f64> for Cauchy
impl Continuous<f64, f64> for Cauchy
Source§impl ContinuousCDF<f64, f64> for Cauchy
impl ContinuousCDF<f64, f64> for Cauchy
Source§fn cdf(&self, x: f64) -> f64
fn cdf(&self, x: f64) -> f64
Calculates the cumulative distribution function for the
cauchy distribution at x
§Formula
(1 / π) * arctan((x - x_0) / γ) + 0.5
where x_0
is the location and γ
is the scale
Source§impl Distribution<f64> for Cauchy
impl Distribution<f64> for Cauchy
impl Copy for Cauchy
impl StructuralPartialEq for Cauchy
Auto Trait Implementations§
impl Freeze for Cauchy
impl RefUnwindSafe for Cauchy
impl Send for Cauchy
impl Sync for Cauchy
impl Unpin for Cauchy
impl UnwindSafe for Cauchy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.