Struct rv::dist::ChiSquared
source · pub struct ChiSquared { /* private fields */ }
Expand description
Implementations§
source§impl ChiSquared
impl ChiSquared
sourcepub fn new(k: f64) -> Result<Self, ChiSquaredError>
pub fn new(k: f64) -> Result<Self, ChiSquaredError>
sourcepub fn new_unchecked(k: f64) -> Self
pub fn new_unchecked(k: f64) -> Self
Create a new ChiSquared without checking whether the parameters are valid.
sourcepub fn k(&self) -> f64
pub fn k(&self) -> f64
Get the degrees of freedom, k
.
§Example
let x2 = ChiSquared::new(1.2).unwrap();
assert_eq!(x2.k(), 1.2);
sourcepub fn set_k(&mut self, k: f64) -> Result<(), ChiSquaredError>
pub fn set_k(&mut self, k: f64) -> Result<(), ChiSquaredError>
Set the degrees of freedom, k
.
§Example
let mut x2 = ChiSquared::new(1.2).unwrap();
x2.set_k(2.2).unwrap();
assert_eq!(x2.k(), 2.2);
Will error given invalid values.
assert!(x2.set_k(2.2).is_ok());
assert!(x2.set_k(0.0).is_err());
assert!(x2.set_k(-1.0).is_err());
assert!(x2.set_k(std::f64::NAN).is_err());
assert!(x2.set_k(std::f64::INFINITY).is_err());
pub fn set_k_unchecked(&mut self, k: f64)
Trait Implementations§
source§impl Cdf<f32> for ChiSquared
impl Cdf<f32> for ChiSquared
source§impl Cdf<f64> for ChiSquared
impl Cdf<f64> for ChiSquared
source§impl Clone for ChiSquared
impl Clone for ChiSquared
source§fn clone(&self) -> ChiSquared
fn clone(&self) -> ChiSquared
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ContinuousDistr<f32> for ChiSquared
impl ContinuousDistr<f32> for ChiSquared
source§impl ContinuousDistr<f64> for ChiSquared
impl ContinuousDistr<f64> for ChiSquared
source§impl Debug for ChiSquared
impl Debug for ChiSquared
source§impl<'de> Deserialize<'de> for ChiSquared
impl<'de> Deserialize<'de> for ChiSquared
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for ChiSquared
impl Display for ChiSquared
source§impl From<&ChiSquared> for String
impl From<&ChiSquared> for String
source§fn from(x2: &ChiSquared) -> String
fn from(x2: &ChiSquared) -> String
Converts to this type from the input type.
source§impl Mean<f32> for ChiSquared
impl Mean<f32> for ChiSquared
source§impl Mean<f64> for ChiSquared
impl Mean<f64> for ChiSquared
source§impl Mode<f32> for ChiSquared
impl Mode<f32> for ChiSquared
source§impl Mode<f64> for ChiSquared
impl Mode<f64> for ChiSquared
source§impl PartialEq for ChiSquared
impl PartialEq for ChiSquared
source§fn eq(&self, other: &ChiSquared) -> bool
fn eq(&self, other: &ChiSquared) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Rv<f32> for ChiSquared
impl Rv<f32> for ChiSquared
source§impl Rv<f64> for ChiSquared
impl Rv<f64> for ChiSquared
source§impl Serialize for ChiSquared
impl Serialize for ChiSquared
source§impl Support<f32> for ChiSquared
impl Support<f32> for ChiSquared
source§impl Support<f64> for ChiSquared
impl Support<f64> for ChiSquared
source§impl Variance<f32> for ChiSquared
impl Variance<f32> for ChiSquared
source§impl Variance<f64> for ChiSquared
impl Variance<f64> for ChiSquared
impl StructuralPartialEq for ChiSquared
Auto Trait Implementations§
impl Freeze for ChiSquared
impl RefUnwindSafe for ChiSquared
impl Send for ChiSquared
impl Sync for ChiSquared
impl Unpin for ChiSquared
impl UnwindSafe for ChiSquared
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<Fx> Rv<Datum> for Fxwhere
Fx: RvDatum,
impl<Fx> Rv<Datum> for Fxwhere
Fx: RvDatum,
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.