[−][src]Struct rv::dist::Gev
Generalized Extreme Value Distribution Gev(μ, σ, ξ) where the parameters are μ is location σ is the scale ξ is the shape
f(x|μ, σ, ξ) = \frac{1}{σ} t(x)^{ξ + 1} e^{-t(x)}
t(x) = ⎰ (1 + ξ ((x - μ) / σ))^(-1/ξ) if ξ ≠ 0
⎱ e^{(μ - x) / σ} if ξ = 0
Implementations
impl Gev
[src]
pub fn new(loc: f64, scale: f64, shape: f64) -> Result<Self, GevError>
[src]
Create a new Gev
distribution with location, scale, and shape.
pub fn new_unchecked(loc: f64, scale: f64, shape: f64) -> Self
[src]
Creates a new Gev without checking whether the parameters are valid.
pub fn loc(&self) -> f64
[src]
Get the location parameter
Example
let gev = Gev::new(1.2, 2.3, 3.4).unwrap(); assert_eq!(gev.loc(), 1.2);
pub fn set_loc(&mut self, loc: f64) -> Result<(), GevError>
[src]
Set the loc parameter without input validation
Example
let mut gev = Gev::new(1.2, 2.3, 3.4).unwrap(); assert_eq!(gev.loc(), 1.2); gev.set_loc(2.8).unwrap(); assert_eq!(gev.loc(), 2.8);
Will error for invalid values
assert!(gev.set_loc(2.8).is_ok()); assert!(gev.set_loc(std::f64::INFINITY).is_err()); assert!(gev.set_loc(std::f64::NEG_INFINITY).is_err()); assert!(gev.set_loc(std::f64::NAN).is_err());
pub fn set_loc_unchecked(&mut self, loc: f64)
[src]
Set the loc parameter without input validation
pub fn shape(&self) -> f64
[src]
Get the shape parameter
Example
let gev = Gev::new(1.2, 2.3, 3.4).unwrap(); assert_eq!(gev.shape(), 3.4);
pub fn set_shape(&mut self, shape: f64) -> Result<(), GevError>
[src]
Set the shape parameter without input validation
Example
let mut gev = Gev::new(1.2, 2.3, 3.4).unwrap(); assert_eq!(gev.shape(), 3.4); gev.set_shape(2.8).unwrap(); assert_eq!(gev.shape(), 2.8);
Will error for invalid values
assert!(gev.set_shape(2.8).is_ok()); assert!(gev.set_shape(std::f64::INFINITY).is_err()); assert!(gev.set_shape(std::f64::NEG_INFINITY).is_err()); assert!(gev.set_shape(std::f64::NAN).is_err());
pub fn set_shape_unchecked(&mut self, shape: f64)
[src]
Set the shape parameter without input validation
pub fn scale(&self) -> f64
[src]
Get the scale parameter
Example
let gev = Gev::new(1.2, 2.3, 3.4).unwrap(); assert_eq!(gev.scale(), 2.3);
pub fn set_scale(&mut self, scale: f64) -> Result<(), GevError>
[src]
Set the scale parameter without input validation
Example
let mut gev = Gev::new(1.2, 2.3, 3.4).unwrap(); assert_eq!(gev.scale(), 2.3); gev.set_scale(2.8).unwrap(); assert_eq!(gev.scale(), 2.8);
Will error for invalid values
assert!(gev.set_scale(2.8).is_ok()); assert!(gev.set_scale(0.0).is_err()); assert!(gev.set_scale(-1.0).is_err()); assert!(gev.set_scale(std::f64::INFINITY).is_err()); assert!(gev.set_scale(std::f64::NEG_INFINITY).is_err()); assert!(gev.set_scale(std::f64::NAN).is_err());
pub fn set_scale_unchecked(&mut self, scale: f64)
[src]
Set the scale parameter without input validation
Trait Implementations
impl Cdf<f32> for Gev
[src]
impl Cdf<f64> for Gev
[src]
impl Clone for Gev
[src]
impl ContinuousDistr<f32> for Gev
[src]
impl ContinuousDistr<f64> for Gev
[src]
impl Debug for Gev
[src]
impl Display for Gev
[src]
impl Entropy for Gev
[src]
impl<'_> From<&'_ Gev> for String
[src]
impl Mean<f32> for Gev
[src]
impl Mean<f64> for Gev
[src]
impl Median<f32> for Gev
[src]
impl Median<f64> for Gev
[src]
impl Mode<f32> for Gev
[src]
impl Mode<f64> for Gev
[src]
impl PartialEq<Gev> for Gev
[src]
impl Rv<f32> for Gev
[src]
pub fn ln_f(&self, x: &f32) -> f64
[src]
pub fn draw<R: Rng>(&self, rng: &mut R) -> f32
[src]
pub fn f(&self, x: &X) -> f64
[src]
pub fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
pub fn sample_stream<'r, R: Rng>(
&'r self,
rng: &'r mut R
) -> Box<dyn Iterator<Item = X> + 'r>
[src]
&'r self,
rng: &'r mut R
) -> Box<dyn Iterator<Item = X> + 'r>
impl Rv<f64> for Gev
[src]
pub fn ln_f(&self, x: &f64) -> f64
[src]
pub fn draw<R: Rng>(&self, rng: &mut R) -> f64
[src]
pub fn f(&self, x: &X) -> f64
[src]
pub fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
pub fn sample_stream<'r, R: Rng>(
&'r self,
rng: &'r mut R
) -> Box<dyn Iterator<Item = X> + 'r>
[src]
&'r self,
rng: &'r mut R
) -> Box<dyn Iterator<Item = X> + 'r>
impl StructuralPartialEq for Gev
[src]
impl Support<f32> for Gev
[src]
impl Support<f64> for Gev
[src]
impl Variance<f64> for Gev
[src]
Auto Trait Implementations
impl RefUnwindSafe for Gev
impl Send for Gev
impl Sync for Gev
impl Unpin for Gev
impl UnwindSafe for Gev
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,