[][src]Struct rv::dist::Cauchy

pub struct Cauchy { /* fields omitted */ }

Cauchy distribution over x in (-∞, ∞).

Example

use rv::prelude::*;

let cauchy = Cauchy::new(1.2, 3.4).expect("Invalid params");
let ln_fx = cauchy.ln_pdf(&0.2_f64); // -2.4514716152673368

assert!((ln_fx + 2.4514716152673368).abs() < 1E-12);

Methods

impl Cauchy[src]

pub fn set_loc(&mut self, val: f64) -> &mut Self[src]

location, x0, in (-∞, ∞)

pub fn set_scale(&mut self, val: f64) -> &mut Self[src]

scale, γ, in (0, ∞)

impl Cauchy[src]

pub fn new(loc: f64, scale: f64) -> Result<Self>[src]

Createa a new Cauchy distribution

Arguments

  • loc: location, x0, in (-∞, ∞)
  • scale: scale, γ, in (0, ∞)

pub fn new_unchecked(loc: f64, scale: f64) -> Self[src]

Create a new Cauchy without checking whether the parameters are valid.

pub fn loc(&self) -> f64[src]

Get the location parameter

Example

let c = Cauchy::new(0.1, 1.0).unwrap();
assert_eq!(c.loc(), 0.1);

pub fn scale(&self) -> f64[src]

Get the scale parameter

Example

let c = Cauchy::new(0.1, 1.0).unwrap();
assert_eq!(c.scale(), 1.0);

Trait Implementations

impl Rv<f64> for Cauchy[src]

impl Rv<f32> for Cauchy[src]

impl Support<f64> for Cauchy[src]

impl Support<f32> for Cauchy[src]

impl ContinuousDistr<f64> for Cauchy[src]

impl ContinuousDistr<f32> for Cauchy[src]

impl Cdf<f64> for Cauchy[src]

impl Cdf<f32> for Cauchy[src]

impl InverseCdf<f64> for Cauchy[src]

impl InverseCdf<f32> for Cauchy[src]

impl Median<f64> for Cauchy[src]

impl Median<f32> for Cauchy[src]

impl Mode<f64> for Cauchy[src]

impl Mode<f32> for Cauchy[src]

impl Entropy for Cauchy[src]

impl<'_> From<&'_ Cauchy> for String[src]

impl Clone for Cauchy[src]

impl Default for Cauchy[src]

impl PartialEq<Cauchy> for Cauchy[src]

impl PartialOrd<Cauchy> for Cauchy[src]

impl Display for Cauchy[src]

impl Debug for Cauchy[src]

Auto Trait Implementations

impl Send for Cauchy

impl Sync for Cauchy

impl Unpin for Cauchy

impl UnwindSafe for Cauchy

impl RefUnwindSafe for Cauchy

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,