pub struct GammaMatrix { /* private fields */ }Trait Implementations§
Source§impl Clone for GammaMatrix
impl Clone for GammaMatrix
Source§impl Debug for GammaMatrix
impl Debug for GammaMatrix
Source§impl Inference for GammaMatrix
impl Inference for GammaMatrix
type Mat = ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>
type Scalar = f32
fn posterior_mean(&self) -> &Self::Mat
fn posterior_sd(&self) -> &Self::Mat
fn posterior_log_mean(&self) -> &Self::Mat
fn posterior_log_sd(&self) -> &Self::Mat
fn posterior_sample(&self) -> Result<Self::Mat>
Source§fn posterior_log_sample(&self, seed: u64) -> Result<Self::Mat>
fn posterior_log_sample(&self, seed: u64) -> Result<Self::Mat>
Draw a fresh sample of
log λ per element. Delta-method
approximation: log λ ≈ Normal(posterior_log_mean, posterior_log_sd²). Caller must have called
calibrate_with(CalibrateTarget::All) first so log_mean / log_sd
are populated. Read morefn nrows(&self) -> usize
fn ncols(&self) -> usize
Source§impl ParamIo for GammaMatrix
impl ParamIo for GammaMatrix
Source§impl TwoStatParam for GammaMatrix
impl TwoStatParam for GammaMatrix
Source§fn new(dims: (usize, usize), a: Self::Scalar, b: Self::Scalar) -> Self
fn new(dims: (usize, usize), a: Self::Scalar, b: Self::Scalar) -> Self
New Poisson-Gamma parameter matrix
x[i,j] ~ Poisson(lambda[i,j])
lambda[i,j] ~ Gamma(a0, b0)#Arguments
dims- dimensions of the matrix (num of rows, num of columns)a- hyper parameter a0b- hyper parameter b0
type Mat = ArrayBase<OwnedRepr<f32>, Dim<[usize; 2]>>
type Scalar = f32
fn add_stat(&mut self, add_a: &Self::Mat, add_b: &Self::Mat)
fn update_stat(&mut self, add_a: &Self::Mat, add_b: &Self::Mat)
fn update_stat_col(&mut self, add_a: &Self::Mat, add_b: &Self::Mat, k: usize)
fn reset_stat(&mut self)
fn map_calibrate_mean(&mut self)
fn map_calibrate_sd(&mut self)
fn map_calibrate_log_mean(&mut self)
fn map_calibrate_log_sd(&mut self)
Source§fn calibrate_with(&mut self, target: CalibrateTarget)
fn calibrate_with(&mut self, target: CalibrateTarget)
Calibrate only the posterior quantities specified by
target.Auto Trait Implementations§
impl Freeze for GammaMatrix
impl RefUnwindSafe for GammaMatrix
impl Send for GammaMatrix
impl Sync for GammaMatrix
impl Unpin for GammaMatrix
impl UnsafeUnpin for GammaMatrix
impl UnwindSafe for GammaMatrix
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.