Skip to main content

NonParametricRunner

Trait NonParametricRunner 

Source
pub trait NonParametricRunner<E: Equation + Send + 'static>:
    Sync
    + Send
    + 'static {
Show 24 methods // Required methods fn error_models(&self) -> &AssayErrorModels; fn equation(&self) -> &E; fn data(&self) -> &Data; 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_result(&self) -> Result<NonParametricResult<E>>; // Provided methods fn check_zero_probability_subjects(&self) -> Result<()> { ... } fn log_zero_probability_subject(&self, subject: &Subject) { ... } fn n2ll(&self) -> f64 { ... } fn initialize(&mut self) -> Result<()> { ... } fn next_cycle(&mut self) -> Result<Status> { ... } fn fit(&mut self) -> Result<NonParametricResult<E>> { ... }
}

Required Methods§

Source

fn error_models(&self) -> &AssayErrorModels

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 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 AssayErrorModels 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_result(&self) -> Result<NonParametricResult<E>>

Provided Methods§

Source

fn check_zero_probability_subjects(&self) -> Result<()>

Identify subjects whose total probability given the model is zero or non-finite.

Each row of Psi holds the likelihood of a subject across every support point, so a subject’s probability is the sum across its row. A subject is flagged when that sum is zero or not finite, meaning the model cannot explain the subject’s data. When any subject is flagged, detailed per-subject diagnostics are logged and an error is returned.

Source

fn log_zero_probability_subject(&self, subject: &Subject)

Log detailed likelihood diagnostics for a single subject whose probability given the model is zero or non-finite.

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<NonParametricResult<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> NonParametricRunner<E> for NCNPAG<E>

Source§

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

Source§

impl<E: Equation + Send + 'static> NonParametricRunner<E> for NPMAP<E>

Source§

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