Skip to main content

NCNPAG

Struct NCNPAG 

Source
pub struct NCNPAG<E: Equation + Send + 'static> { /* private fields */ }
Expand description

Non-collapsing NPAG (NCNPAG) algorithm.

Individualizes a set of prior support points to a subject’s data in two steps, without collapsing (merging) the points:

  1. Bayesian filtering. Evaluate the likelihood P(data | θⱼ) for each prior support point, apply a flat (uniform) prior so the posterior weight is proportional to the likelihood (postⱼ ∝ ∏ᵢ P(dataᵢ | θⱼ)), drop points whose normalized weight falls below 1e-100 × max, and renormalize the survivors.
  2. Per-point NPAG refinement. When cycles > 0, seed a full NPAG run from each surviving point and replace it with the resulting daughter point, preserving its filter weight. Points whose refinement fails or yields nothing are kept at their original location.

The result is returned as a standard NonParametricResult, so the (theta, weights) can be consumed exactly like any other fit.

Trait Implementations§

Source§

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

Source§

fn fit(&mut self) -> Result<NonParametricResult<E>>

NCNPAG is a single-pass reweighting: it evaluates the likelihood of the fixed prior support points once, rather than iterating cycles.

Source§

fn into_result(&self) -> Result<NonParametricResult<E>>

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 likelihood(&self) -> f64

Get the current likelihood
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 set_status(&mut self, status: Status)

Set the current Status of the algorithm
Source§

fn status(&self) -> &Status

Get the current Status of the algorithm
Source§

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

Evaluate convergence criteria and update status
Source§

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

Source§

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

Performs condensation of Theta and updates Psi Read more
Source§

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

Performs optimizations on the current AssayErrorModels and updates Psi accordingly Read more
Source§

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

Performs expansion of Theta Read more
Source§

fn log_cycle_state(&mut self)

Create and log a cycle state with the current algorithm state
Source§

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

Identify subjects whose total probability given the model is zero or non-finite. Read more
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 Read more

Auto Trait Implementations§

§

impl<E> Freeze for NCNPAG<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for NCNPAG<E>
where E: RefUnwindSafe,

§

impl<E> Send for NCNPAG<E>

§

impl<E> Sync for NCNPAG<E>

§

impl<E> Unpin for NCNPAG<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for NCNPAG<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for NCNPAG<E>
where E: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

§

impl<T> DistributionExt for T
where T: ?Sized,

§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SendAlias for T

§

impl<T> SyncAlias for T