pub trait Algorithms<E: Equation + Send + 'static>:
Sync
+ Send
+ 'static {
Show 25 methods
// Required methods
fn new(config: Settings, equation: E, data: Data) -> Result<Box<Self>>
where Self: Sized;
fn settings(&self) -> &Settings;
fn equation(&self) -> &E;
fn data(&self) -> &Data;
fn get_prior(&self) -> Theta;
fn increment_cycle(&mut self) -> usize;
fn cycle(&self) -> usize;
fn set_theta(&mut self, theta: Theta);
fn theta(&self) -> Θ
fn psi(&self) -> Ψ
fn likelihood(&self) -> f64;
fn status(&self) -> &Status;
fn set_status(&mut self, status: Status);
fn evaluation(&mut self) -> Result<Status>;
fn log_cycle_state(&mut self);
fn estimation(&mut self) -> Result<()>;
fn condensation(&mut self) -> Result<()>;
fn optimizations(&mut self) -> Result<()>;
fn expansion(&mut self) -> Result<()>;
fn into_npresult(&self) -> NPResult<E>;
// Provided methods
fn validate_psi(&mut self) -> Result<()> { ... }
fn n2ll(&self) -> f64 { ... }
fn initialize(&mut self) -> Result<()> { ... }
fn next_cycle(&mut self) -> Result<Status> { ... }
fn fit(&mut self) -> Result<NPResult<E>> { ... }
}Required Methods§
fn new(config: Settings, equation: E, data: Data) -> Result<Box<Self>>where
Self: Sized,
fn settings(&self) -> &Settings
fn get_prior(&self) -> Theta
Sourcefn increment_cycle(&mut self) -> usize
fn increment_cycle(&mut self) -> usize
Increment the cycle counter and return the new value
Sourcefn likelihood(&self) -> f64
fn likelihood(&self) -> f64
Get the current likelihood
Sourcefn set_status(&mut self, status: Status)
fn set_status(&mut self, status: Status)
Set the current Status of the algorithm
Sourcefn evaluation(&mut self) -> Result<Status>
fn evaluation(&mut self) -> Result<Status>
Evaluate convergence criteria and update status
Sourcefn log_cycle_state(&mut self)
fn log_cycle_state(&mut self)
Create and log a cycle state with the current algorithm state
fn estimation(&mut self) -> Result<()>
Sourcefn condensation(&mut self) -> Result<()>
fn condensation(&mut self) -> Result<()>
Sourcefn optimizations(&mut self) -> Result<()>
fn optimizations(&mut self) -> Result<()>
fn into_npresult(&self) -> NPResult<E>
Provided Methods§
fn validate_psi(&mut self) -> Result<()>
Sourcefn initialize(&mut self) -> Result<()>
fn initialize(&mut self) -> Result<()>
Sourcefn next_cycle(&mut self) -> Result<Status>
fn next_cycle(&mut self) -> Result<Status>
Proceed to the next cycle of the algorithm
This method increments the cycle counter, performs expansion if necessary, and then runs the estimation, condensation, optimization, logging, and evaluation steps in sequence. It returns the current Status of the algorithm after completing these steps.
Sourcefn fit(&mut self) -> Result<NPResult<E>>
fn fit(&mut self) -> Result<NPResult<E>>
Fit the model until convergence or stopping criteria are met
This method runs the full fitting process, starting with initialization, followed by iterative cycles of estimation, condensation, optimization, and evaluation until the algorithm converges or meets a stopping criteria.