[−][src]Struct rv::dist::NormalGamma
Prior for Gaussian
Given x ~ N(μ, σ)
, the Normal Gamma prior implies that μ ~ N(m, 1/(rρ))
and ρ ~ Gamma(ν/2, s/2)
.
Methods
impl NormalGamma
[src]
pub fn set_m(&mut self, val: f64) -> &mut Self
[src]
pub fn set_r(&mut self, val: f64) -> &mut Self
[src]
pub fn set_s(&mut self, val: f64) -> &mut Self
[src]
pub fn set_v(&mut self, val: f64) -> &mut Self
[src]
impl NormalGamma
[src]
pub fn new(m: f64, r: f64, s: f64, v: f64) -> Result<Self, NormalGammaError>
[src]
Create a new Normal Gamma distribution
Arguments
- m: The prior mean
- r: Relative precision of μ versus data
- s: The mean of rho (the precision) is v/s.
- v: Degrees of freedom of precision of rho
pub fn new_unchecked(m: f64, r: f64, s: f64, v: f64) -> Self
[src]
Creates a new NormalGamma without checking whether the parameters are valid.
pub fn m(&self) -> f64
[src]
Get the m parameter
pub fn r(&self) -> f64
[src]
Get the r parameter
pub fn s(&self) -> f64
[src]
Get the s parameter
pub fn v(&self) -> f64
[src]
Get the v parameter
Trait Implementations
impl Clone for NormalGamma
[src]
fn clone(&self) -> NormalGamma
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl ConjugatePrior<f64, Gaussian> for NormalGamma
[src]
type Posterior = Self
fn posterior(&self, x: &DataOrSuffStat<f64, Gaussian>) -> Self
[src]
fn ln_m(&self, x: &DataOrSuffStat<f64, Gaussian>) -> f64
[src]
fn ln_pp(&self, y: &f64, x: &DataOrSuffStat<f64, Gaussian>) -> f64
[src]
fn m(&self, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
fn pp(&self, y: &X, x: &DataOrSuffStat<X, Fx>) -> f64
[src]
impl ContinuousDistr<Gaussian> for NormalGamma
[src]
impl Debug for NormalGamma
[src]
impl Display for NormalGamma
[src]
impl<'_> From<&'_ NormalGamma> for String
[src]
fn from(ng: &NormalGamma) -> String
[src]
impl HasSuffStat<f64> for NormalGamma
[src]
type Stat = GaussianSuffStat
fn empty_suffstat(&self) -> Self::Stat
[src]
impl PartialEq<NormalGamma> for NormalGamma
[src]
fn eq(&self, other: &NormalGamma) -> bool
[src]
fn ne(&self, other: &NormalGamma) -> bool
[src]
impl PartialOrd<NormalGamma> for NormalGamma
[src]
fn partial_cmp(&self, other: &NormalGamma) -> Option<Ordering>
[src]
fn lt(&self, other: &NormalGamma) -> bool
[src]
fn le(&self, other: &NormalGamma) -> bool
[src]
fn gt(&self, other: &NormalGamma) -> bool
[src]
fn ge(&self, other: &NormalGamma) -> bool
[src]
impl Rv<Gaussian> for NormalGamma
[src]
fn ln_f(&self, x: &Gaussian) -> f64
[src]
fn draw<R: Rng>(&self, rng: &mut R) -> Gaussian
[src]
fn f(&self, x: &X) -> f64
[src]
fn sample<R: Rng>(&self, n: usize, rng: &mut R) -> Vec<X>
[src]
impl StructuralPartialEq for NormalGamma
[src]
impl Support<Gaussian> for NormalGamma
[src]
Auto Trait Implementations
impl RefUnwindSafe for NormalGamma
impl Send for NormalGamma
impl Sync for NormalGamma
impl Unpin for NormalGamma
impl UnwindSafe for NormalGamma
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Fx, X> ContinuousDistr<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: ContinuousDistr<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: ContinuousDistr<X>,
impl<T> From<T> for T
[src]
impl<Fx, X> HasSuffStat<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: HasSuffStat<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: HasSuffStat<X>,
type Stat = <<Fx as Deref>::Target as HasSuffStat<X>>::Stat
fn empty_suffstat(&Self) -> <Fx as HasSuffStat<X>>::Stat
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<Fx, X> Rv<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: Rv<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: Rv<X>,
fn ln_f(&Self, &X) -> f64
[src]
fn f(&Self, &X) -> f64
[src]
fn draw<R>(&Self, &mut R) -> X where
R: Rng,
[src]
R: Rng,
fn sample<R>(&Self, usize, &mut R) -> Vec<X> where
R: Rng,
[src]
R: Rng,
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>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<Fx, X> Support<X> for Fx where
Fx: Deref,
<Fx as Deref>::Target: Support<X>,
[src]
Fx: Deref,
<Fx as Deref>::Target: Support<X>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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.
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>,