pub struct EstimationProblem<E: Equation, F: Framework> { /* private fields */ }Implementations§
Source§impl<E: Equation + Send + 'static> EstimationProblem<E, NonParametric>
impl<E: Equation + Send + 'static> EstimationProblem<E, NonParametric>
Sourcepub fn fit_controller(
self,
algorithm: impl Into<NonParametricAlgorithm>,
) -> Result<FitController<E>>
pub fn fit_controller( self, algorithm: impl Into<NonParametricAlgorithm>, ) -> Result<FitController<E>>
Start a fit you drive yourself, one step at a time.
Takes any non-parametric config (NpagConfig, NpodConfig, NpmapConfig) or a
NonParametricAlgorithm.
use pmcore::prelude::*;
let mut controller = problem.fit_controller(NpagConfig::new())?;
while controller.step()?.is_continue() {
println!("cycle {} | -2LL {:.4}", controller.cycle(), controller.n2ll());
}
let result = controller.into_result()?;Sourcepub fn fit_with_observer<O: FitObserver<E>>(
self,
algorithm: impl Into<NonParametricAlgorithm>,
observer: O,
) -> Result<NonParametricResult<E>>
pub fn fit_with_observer<O: FitObserver<E>>( self, algorithm: impl Into<NonParametricAlgorithm>, observer: O, ) -> Result<NonParametricResult<E>>
Run a fit to completion, calling observer after every cycle.
The observer sees every cycle, the last one included, and can return
CycleFlow::Stop to bail out early. Returns the same result as
fit_with.
use pmcore::prelude::*;
let result = problem.fit_with_observer(NpagConfig::new(), |c: &FitController<_>| {
println!("cycle {} | -2LL {:.4}", c.cycle(), c.n2ll());
CycleFlow::Continue
})?;Source§impl<E: Equation, F: Framework> EstimationProblem<E, F>
impl<E: Equation, F: Framework> EstimationProblem<E, F>
Source§impl<E: Equation + EquationMetadataSource> EstimationProblem<E, NonParametric>
impl<E: Equation + EquationMetadataSource> EstimationProblem<E, NonParametric>
Sourcepub fn nonparametric(
equation: E,
data: Data,
prior: Theta,
error_models: AssayErrorModels,
) -> Result<Self>
pub fn nonparametric( equation: E, data: Data, prior: Theta, error_models: AssayErrorModels, ) -> Result<Self>
Creates a non-parametric estimation problem.
The prior is a Theta holding the prior distribution (the initial
set of support points) together with the ParameterSpace it was built
from. The parameter space is taken directly from the prior, so there is
no separate parameter-declaration step.
Source§impl<E: Equation> EstimationProblem<E, Parametric>
impl<E: Equation> EstimationProblem<E, Parametric>
Sourcepub fn parametric(equation: E, data: Data) -> ParametricBuilder<E>
pub fn parametric(equation: E, data: Data) -> ParametricBuilder<E>
Begins building a parametric estimation problem.
Sourcepub fn parameters(&self) -> &ParameterSpace<UnboundedParameter>
pub fn parameters(&self) -> &ParameterSpace<UnboundedParameter>
Returns the parameter space defined for this problem.
Source§impl<E: Equation> EstimationProblem<E, NonParametric>
impl<E: Equation> EstimationProblem<E, NonParametric>
Sourcepub fn parameters(&self) -> &ParameterSpace<BoundedParameter>
pub fn parameters(&self) -> &ParameterSpace<BoundedParameter>
Returns the parameter space carried by the prior Theta.
Trait Implementations§
Auto Trait Implementations§
impl<E, F> Freeze for EstimationProblem<E, F>
impl<E, F> RefUnwindSafe for EstimationProblem<E, F>where
<F as Framework>::ErrorModels: RefUnwindSafe,
<F as Framework>::Prior: RefUnwindSafe,
E: RefUnwindSafe,
impl<E, F> Send for EstimationProblem<E, F>
impl<E, F> Sync for EstimationProblem<E, F>
impl<E, F> Unpin for EstimationProblem<E, F>
impl<E, F> UnsafeUnpin for EstimationProblem<E, F>where
<F as Framework>::ErrorModels: UnsafeUnpin,
<F as Framework>::Prior: UnsafeUnpin,
E: UnsafeUnpin,
impl<E, F> UnwindSafe for EstimationProblem<E, F>where
<F as Framework>::ErrorModels: UnwindSafe,
<F as Framework>::Prior: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.