Algorithms

Trait Algorithms 

Source
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) -> &Theta; fn psi(&self) -> &Psi; 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§

Source

fn new(config: Settings, equation: E, data: Data) -> Result<Box<Self>>
where Self: Sized,

Source

fn settings(&self) -> &Settings

Source

fn equation(&self) -> &E

Get the equation used in the algorithm

Source

fn data(&self) -> &Data

Get the data used in the algorithm

Source

fn get_prior(&self) -> Theta

Source

fn increment_cycle(&mut self) -> usize

Increment the cycle counter and return the new value

Source

fn cycle(&self) -> usize

Get the current cycle number

Source

fn set_theta(&mut self, theta: Theta)

Set the current Theta

Source

fn theta(&self) -> &Theta

Get the current Theta

Source

fn psi(&self) -> &Psi

Get the current Psi

Source

fn likelihood(&self) -> f64

Get the current likelihood

Source

fn status(&self) -> &Status

Get the current Status of the algorithm

Source

fn set_status(&mut self, status: Status)

Set the current Status of the algorithm

Source

fn evaluation(&mut self) -> Result<Status>

Evaluate convergence criteria and update status

Source

fn log_cycle_state(&mut self)

Create and log a cycle state with the current algorithm state

Source

fn estimation(&mut self) -> Result<()>

Source

fn condensation(&mut self) -> Result<()>

Performs condensation of Theta and updates Psi

This step reduces the number of support points in Theta based on the current weights, and updates the Psi matrix accordingly to reflect the new set of support points. It is typically performed after the estimation step in each cycle of the algorithm.

Source

fn optimizations(&mut self) -> Result<()>

Performs optimizations on the current [ErrorModels] and updates Psi accordingly

This step refines the error model parameters to better fit the data, and subsequently updates the Psi matrix to reflect these changes.

Source

fn expansion(&mut self) -> Result<()>

Performs expansion of Theta

This step increases the number of support points in Theta based on the current distribution, allowing for exploration of the parameter space.

Source

fn into_npresult(&self) -> NPResult<E>

Provided Methods§

Source

fn validate_psi(&mut self) -> Result<()>

Source

fn n2ll(&self) -> f64

Get the current negative two log-likelihood

Source

fn initialize(&mut self) -> Result<()>

Initialize the algorithm, setting up initial Theta and Status

Source

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.

Source

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.

Implementors§

Source§

impl<E: Equation + Send + 'static> Algorithms<E> for NPAG<E>

Source§

impl<E: Equation + Send + 'static> Algorithms<E> for NPOD<E>

Source§

impl<E: Equation + Send + 'static> Algorithms<E> for POSTPROB<E>