Struct statrs::distribution::Cauchy [−][src]
Implements the Cauchy distribution, also known as the Lorentz distribution.
Examples
use statrs::distribution::{Cauchy, Continuous}; use statrs::statistics::Mode; let n = Cauchy::new(0.0, 1.0).unwrap(); assert_eq!(n.mode(), 0.0); assert_eq!(n.pdf(1.0), 0.1591549430918953357689);
Implementations
impl Cauchy
[src][−]
pub fn new(location: f64, scale: f64) -> Result<Cauchy>
[src][−]
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());
pub fn location(&self) -> f64
[src][−]
Returns the location of the cauchy distribution
Examples
use statrs::distribution::Cauchy; let n = Cauchy::new(0.0, 1.0).unwrap(); assert_eq!(n.location(), 0.0);
pub fn scale(&self) -> f64
[src][−]
Returns the scale of the cauchy distribution
Examples
use statrs::distribution::Cauchy; let n = Cauchy::new(0.0, 1.0).unwrap(); assert_eq!(n.scale(), 1.0);
Trait Implementations
impl Clone for Cauchy
[src][+]
impl Continuous<f64, f64> for Cauchy
[src][+]
impl Copy for Cauchy
[src]
impl Debug for Cauchy
[src][+]
impl Distribution<f64> for Cauchy
[src][+]
impl Entropy<f64> for Cauchy
[src][+]
impl Max<f64> for Cauchy
[src][+]
impl Median<f64> for Cauchy
[src][+]
impl Min<f64> for Cauchy
[src][+]
impl Mode<f64> for Cauchy
[src][+]
impl PartialEq<Cauchy> for Cauchy
[src][+]
impl StructuralPartialEq for Cauchy
[src]
impl Univariate<f64, f64> for Cauchy
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for Cauchy
impl Send for Cauchy
impl Sync for Cauchy
impl Unpin for Cauchy
impl UnwindSafe for Cauchy
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src][+]
V: MultiLane<T>,