pub struct FitResult<Model, const MRHS: bool>{
pub problem: LevMarProblem<Model, MRHS>,
pub minimization_report: MinimizationReport<Model::ScalarType>,
}
Expand description
A helper type that contains the fitting problem after the minimization, as well as a report and some convenience functions
Fields§
§problem: LevMarProblem<Model, MRHS>
the final state of the fitting problem after the minimization finished (regardless of whether fitting was successful or not)
minimization_report: MinimizationReport<Model::ScalarType>
the minimization report of the underlying solver. It contains information about the minimization process and should be queried to see whether the minimization was considered successful
Implementations§
source§impl<Model> FitResult<Model, true>
impl<Model> FitResult<Model, true>
sourcepub fn linear_coefficients(
&self
) -> Option<MatrixView<'_, Model::ScalarType, Dyn, Dyn>>
pub fn linear_coefficients( &self ) -> Option<MatrixView<'_, Model::ScalarType, Dyn, Dyn>>
Note This implementation is for fitting problems with multiple right hand sides.
Convenience function to get the linear coefficients after the fit has finished. Will return None if there was an error during fitting.
The coefficients vectors for the individual members of the datasets are the colums of the returned matrix. That means one coefficient vector for each right hand side.
sourcepub fn best_fit(&self) -> Option<OMatrix<Model::ScalarType, Dyn, Dyn>>
pub fn best_fit(&self) -> Option<OMatrix<Model::ScalarType, Dyn, Dyn>>
Note This implementation is for fitting problems with a single right hand side.
Calculate the values of the model at the best fit parameters. Returns None if there was an error during fitting. Since this is for single right hand sides, the output is a column vector.
source§impl<Model> FitResult<Model, false>
impl<Model> FitResult<Model, false>
sourcepub fn linear_coefficients(
&self
) -> Option<VectorView<'_, Model::ScalarType, Dyn>>
pub fn linear_coefficients( &self ) -> Option<VectorView<'_, Model::ScalarType, Dyn>>
Note This implementation is for fitting problems with a single right hand side.
Convenience function to get the linear coefficients after the fit has finished. Will return None if there was an error during fitting. The coefficients are given as a single vector.
sourcepub fn best_fit(&self) -> Option<OVector<Model::ScalarType, Dyn>>
pub fn best_fit(&self) -> Option<OVector<Model::ScalarType, Dyn>>
Note This implementation is for fitting problems with multiple right hand sides
Calculate the values of the model at the best fit parameters. Returns None if there was an error during fitting. Since this is for single right hand sides, the output is a matrix containing composed of column vectors for the right hand sides.
source§impl<Model, const MRHS: bool> FitResult<Model, MRHS>
impl<Model, const MRHS: bool> FitResult<Model, MRHS>
sourcepub fn nonlinear_parameters(&self) -> OVector<Model::ScalarType, Dyn>
pub fn nonlinear_parameters(&self) -> OVector<Model::ScalarType, Dyn>
convenience function to get the nonlinear parameters of the model after the fitting process has finished.
sourcepub fn was_successful(&self) -> bool
pub fn was_successful(&self) -> bool
whether the fit was deemeed successful. The fit might still be not be optimal for numerical reasons, but the minimization process terminated successfully.
Trait Implementations§
Auto Trait Implementations§
impl<Model, const MRHS: bool> Freeze for FitResult<Model, MRHS>
impl<Model, const MRHS: bool> RefUnwindSafe for FitResult<Model, MRHS>
impl<Model, const MRHS: bool> Send for FitResult<Model, MRHS>
impl<Model, const MRHS: bool> Sync for FitResult<Model, MRHS>
impl<Model, const MRHS: bool> Unpin for FitResult<Model, MRHS>
impl<Model, const MRHS: bool> UnwindSafe for FitResult<Model, MRHS>
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§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).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.