Skip to main content

VonMises

Struct VonMises 

Source
pub struct VonMises {
    pub mu: f64,
    pub kappa: f64,
}
Expand description

The von Mises distribution on the circle, f(x) ∝ e^{κ cos(x − μ)} on [μ − π, μ + π] (SciPy’s vonmises(kappa=κ, loc=μ)).

Fields§

§mu: f64§kappa: f64

Implementations§

Source§

impl VonMises

Source

pub fn new(mu: f64, kappa: f64) -> Result<Self, ErrorsJSL>

Source

pub fn mean_resultant_length(&self) -> f64

The mean resultant length A(κ) = I₁(κ)/I₀(κ).

Trait Implementations§

Source§

impl Clone for VonMises

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContinuousDistribution for VonMises

Source§

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

The Fourier series F(x) = (x − μ + π + 2 Σ_j A_j(κ) sin(j(x − μ)) / j) / (2π) with A_j = I_j(κ)/I₀(κ).

Source§

fn variance(&self) -> f64

The variance of the linear variable on [μ − π, μ + π]: π²/3 + 4 Σ (−1)ʲ A_j / j².

Source§

fn excess_kurtosis(&self) -> f64

E(x−μ)⁴ / σ⁴ − 3, with E(x−μ)⁴ = π⁴/5 + Σ (−1)ʲ A_j (8π²/j² − 48/j⁴).

Source§

fn pdf(&self, x: f64) -> f64

The probability density.
Source§

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

The interval [a, b] outside which the density is zero.
Source§

fn mean(&self) -> f64

Source§

fn skewness(&self) -> f64

Source§

fn logpdf(&self, x: f64) -> f64

The log density (more accurate than pdf(x).ln() in the tails where overridden).
Source§

fn sf(&self, x: f64) -> f64

The survival function P(X > x).
Source§

fn ppf(&self, p: f64) -> f64

The quantile (percent-point) function, the inverse of the distribution function.
Source§

fn isf(&self, q: f64) -> f64

The inverse survival function.
Source§

fn std(&self) -> f64

Source§

fn median(&self) -> f64

Source§

fn interval(&self, confidence: f64) -> (f64, f64)

The central interval containing a fraction confidence of the probability.
Source§

fn log_likelihood(&self, data: &[f64]) -> f64

Σ log f(xᵢ).
Source§

fn sample<U: UniformGenerator>(&self, rng: &mut U) -> f64
where Self: Sized,

A sample by inversion, ppf(U).
Source§

impl Copy for VonMises

Source§

impl Debug for VonMises

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Fit for VonMises

Source§

fn fit(data: &[f64]) -> Result<Self, ErrorsJSL>

μ = atan2(Σ sin x, Σ cos x) and κ solves A(κ) = R̄, the mean resultant length.

Source§

impl PartialEq for VonMises

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VonMises

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.