Skip to main content

Pareto3Dist

Struct Pareto3Dist 

Source
pub struct Pareto3Dist {
    pub mu: f64,
    pub sigma: f64,
    pub gamma: f64,
}
Expand description

Struct for the Pareto (type III) distribution X ~ Pareto3(mu, sigma, gamma).

§Parameters

  • -infinity < mu < infinity
  • sigma > 0
  • gamma > 0

§Support

  • x >= mu

§Example

Suppose X ~ Pareto3(mu=0.0, sigma=1.0, gamma=2.0). Use

use ruststat::Pareto3Dist;
let mut mydist = Pareto3Dist{mu:0.0, sigma:1.0, gamma:2.0};
println!("Probability density function f(1.5): {}", mydist.pdf(1.5));
println!("Cumulative distribution function P(X<=110.0): {}", mydist.cdf(1.5));
println!("99th percentile: {}", mydist.per(0.99));
println!("Random draw: {}", mydist.ran());
println!("Random vector: {:?}", mydist.ranvec(5));
println!("Mean: {}", mydist.mean());
println!("Variance: {}", mydist.var());
println!("Standard deviation: {}", mydist.sd());

Fields§

§mu: f64§sigma: f64§gamma: f64

Implementations§

Source§

impl Pareto3Dist

Source

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

Source

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

Source

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

Source

pub fn ran(&mut self) -> f64

Source

pub fn ranvec(&mut self, n: u64) -> Vec<f64>

Source

pub fn mean(&mut self) -> f64

Source

pub fn var(&mut self) -> f64

Source

pub fn sd(&mut self) -> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.