pub trait Em<const N: usize, I>: EmStep {
// Required method
fn e_step(&mut self, sfs: Sfs<N>, input: &I) -> (Self::Status, USfs<N>);
// Provided methods
fn em_step(&mut self, sfs: Sfs<N>, input: &I) -> (Self::Status, Sfs<N>) { ... }
fn em<S>(
&mut self,
sfs: Sfs<N>,
input: &I,
stopping_rule: S,
) -> (Self::Status, Sfs<N>)
where S: Stop<Self, Status = Self::Status> { ... }
}Expand description
A type capable of running an EM-like algorithm for SFS inference using data in-memory.
Required Methods§
Provided Methods§
Sourcefn em_step(&mut self, sfs: Sfs<N>, input: &I) -> (Self::Status, Sfs<N>)
fn em_step(&mut self, sfs: Sfs<N>, input: &I) -> (Self::Status, Sfs<N>)
A full EM-step of the algorithm.
Like the Em::e_step, this should correspond to a full pass over the input.
§Panics
Panics if the shapes of the SFS and the input do not match.
Sourcefn em<S>(
&mut self,
sfs: Sfs<N>,
input: &I,
stopping_rule: S,
) -> (Self::Status, Sfs<N>)
fn em<S>( &mut self, sfs: Sfs<N>, input: &I, stopping_rule: S, ) -> (Self::Status, Sfs<N>)
Runs the EM algorithm until convergence.
This consists of running EM-steps until convergence, which is decided by the provided
stopping_rule. The converged SFS, and the status of the last EM-step, are returned.
§Panics
Panics if the shapes of the SFS and the input do not match.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.