Struct ErrorModels
pub struct ErrorModels { /* private fields */ }
Expand description
Collection of error models for all possible outputs in the model/dataset This struct holds a vector of error models, each corresponding to a specific output in the pharmacometric analysis.
This is a wrapper around a vector of ErrorModels, its size is determined by the number of outputs in the model/dataset.
Implementations§
§impl ErrorModels
impl ErrorModels
pub fn new() -> ErrorModels
pub fn new() -> ErrorModels
pub fn error_model(&self, outeq: usize) -> Result<&ErrorModel, ErrorModelError>
pub fn error_model(&self, outeq: usize) -> Result<&ErrorModel, ErrorModelError>
Get the error model for a specific output equation
§Arguments
outeq
- The index of the output equation for which to retrieve the error model.
§Returns
A reference to the ErrorModel for the specified output equation.
§Errors
If the output equation index is invalid, an ErrorModelError::InvalidOutputEquation is returned.
pub fn add(
self,
outeq: usize,
model: ErrorModel,
) -> Result<ErrorModels, ErrorModelError>
pub fn add( self, outeq: usize, model: ErrorModel, ) -> Result<ErrorModels, ErrorModelError>
Add a new error model for a specific output equation
§Arguments
outeq
- The index of the output equation for which to add the error model.model
- The ErrorModel to add for the specified output equation.
§Returns
A new instance of ErrorModels with the added model.
§Errors
If the output equation index is invalid or if a model already exists for that output equation, an ErrorModelError::ExistingOutputEquation is returned.
pub fn iter(&self) -> impl Iterator<Item = (usize, &ErrorModel)>
pub fn iter(&self) -> impl Iterator<Item = (usize, &ErrorModel)>
Returns an iterator over the error models in the collection.
§Returns
An iterator that yields tuples containing the index and a reference to each ErrorModel.
pub fn into_iter(self) -> impl Iterator<Item = (usize, ErrorModel)>
pub fn into_iter(self) -> impl Iterator<Item = (usize, ErrorModel)>
Returns an iterator that yields mutable references to the error models in the collection.
§Returns
An iterator that yields tuples containing the index and a mutable reference to each ErrorModel.
pub fn iter_mut(&mut self) -> impl Iterator<Item = (usize, &mut ErrorModel)>
pub fn iter_mut(&mut self) -> impl Iterator<Item = (usize, &mut ErrorModel)>
Returns a mutable iterator that yields mutable references to the error models in the collection.
§Returns
An iterator that yields tuples containing the index and a mutable reference to each ErrorModel.
pub fn hash(&self) -> u64
pub fn hash(&self) -> u64
Computes a hash for the error models collection. This hash is based on the output equations and their associated error models.
§Returns
A u64
hash value representing the error models collection.
pub fn errorpoly(&self, outeq: usize) -> Result<ErrorPoly, ErrorModelError>
pub fn errorpoly(&self, outeq: usize) -> Result<ErrorPoly, ErrorModelError>
pub fn factor(&self, outeq: usize) -> Result<f64, ErrorModelError>
pub fn factor(&self, outeq: usize) -> Result<f64, ErrorModelError>
pub fn set_errorpoly(
&mut self,
outeq: usize,
poly: ErrorPoly,
) -> Result<(), ErrorModelError>
pub fn set_errorpoly( &mut self, outeq: usize, poly: ErrorPoly, ) -> Result<(), ErrorModelError>
pub fn set_factor(
&mut self,
outeq: usize,
factor: f64,
) -> Result<(), ErrorModelError>
pub fn set_factor( &mut self, outeq: usize, factor: f64, ) -> Result<(), ErrorModelError>
Sets the factor value for the specified output equation.
§Arguments
outeq
- The index of the output equation.factor
- The new factor value to set.
pub fn factor_param(&self, outeq: usize) -> Result<Factor, ErrorModelError>
pub fn factor_param(&self, outeq: usize) -> Result<Factor, ErrorModelError>
pub fn set_factor_param(
&mut self,
outeq: usize,
param: Factor,
) -> Result<(), ErrorModelError>
pub fn set_factor_param( &mut self, outeq: usize, param: Factor, ) -> Result<(), ErrorModelError>
pub fn is_factor_fixed(&self, outeq: usize) -> Result<bool, ErrorModelError>
pub fn is_factor_fixed(&self, outeq: usize) -> Result<bool, ErrorModelError>
pub fn fix_factor(&mut self, outeq: usize) -> Result<(), ErrorModelError>
pub fn fix_factor(&mut self, outeq: usize) -> Result<(), ErrorModelError>
Makes the factor parameter fixed at its current value for the specified output equation.
§Arguments
outeq
- The index of the output equation.
pub fn unfix_factor(&mut self, outeq: usize) -> Result<(), ErrorModelError>
pub fn unfix_factor(&mut self, outeq: usize) -> Result<(), ErrorModelError>
Makes the factor parameter variable at its current value for the specified output equation.
§Arguments
outeq
- The index of the output equation.
pub fn sigma(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
pub fn sigma(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
Computes the standard deviation (sigma) for the specified output equation and prediction.
§Arguments
outeq
- The index of the output equation.prediction
- ThePrediction
to use for the calculation.
§Returns
A Result
containing the computed sigma value or an ErrorModelError
if the calculation fails.
pub fn variance(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
pub fn variance(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
Computes the variance for the specified output equation and prediction.
§Arguments
outeq
- The index of the output equation.prediction
- ThePrediction
to use for the calculation.
§Returns
A Result
containing the computed variance or an ErrorModelError
if the calculation fails.
pub fn sigma_from_value(
&self,
outeq: usize,
value: f64,
) -> Result<f64, ErrorModelError>
pub fn sigma_from_value( &self, outeq: usize, value: f64, ) -> Result<f64, ErrorModelError>
Computes the standard deviation (sigma) for the specified output equation and value.
§Arguments
outeq
- The index of the output equation.value
- The value to use for the calculation.
§Returns
A Result
containing the computed sigma value or an ErrorModelError
if the calculation fails.
pub fn variance_from_value(
&self,
outeq: usize,
value: f64,
) -> Result<f64, ErrorModelError>
pub fn variance_from_value( &self, outeq: usize, value: f64, ) -> Result<f64, ErrorModelError>
Computes the variance for the specified output equation and value.
§Arguments
outeq
- The index of the output equation.value
- The value to use for the calculation.
§Returns
A Result
containing the computed variance or an ErrorModelError
if the calculation fails.
Trait Implementations§
§impl Clone for ErrorModels
impl Clone for ErrorModels
§fn clone(&self) -> ErrorModels
fn clone(&self) -> ErrorModels
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for ErrorModels
impl Debug for ErrorModels
§impl Default for ErrorModels
impl Default for ErrorModels
§fn default() -> ErrorModels
fn default() -> ErrorModels
§impl<'de> Deserialize<'de> for ErrorModels
impl<'de> Deserialize<'de> for ErrorModels
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorModels, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorModels, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl From<Vec<ErrorModel>> for ErrorModels
impl From<Vec<ErrorModel>> for ErrorModels
§fn from(models: Vec<ErrorModel>) -> ErrorModels
fn from(models: Vec<ErrorModel>) -> ErrorModels
§impl<'a> IntoIterator for &'a ErrorModels
impl<'a> IntoIterator for &'a ErrorModels
§type Item = (usize, &'a ErrorModel)
type Item = (usize, &'a ErrorModel)
§type IntoIter = Enumerate<Iter<'a, ErrorModel>>
type IntoIter = Enumerate<Iter<'a, ErrorModel>>
§fn into_iter(self) -> <&'a ErrorModels as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a ErrorModels as IntoIterator>::IntoIter
§impl<'a> IntoIterator for &'a mut ErrorModels
impl<'a> IntoIterator for &'a mut ErrorModels
§type Item = (usize, &'a mut ErrorModel)
type Item = (usize, &'a mut ErrorModel)
§type IntoIter = Enumerate<IterMut<'a, ErrorModel>>
type IntoIter = Enumerate<IterMut<'a, ErrorModel>>
§fn into_iter(self) -> <&'a mut ErrorModels as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a mut ErrorModels as IntoIterator>::IntoIter
§impl IntoIterator for ErrorModels
impl IntoIterator for ErrorModels
§type Item = (usize, ErrorModel)
type Item = (usize, ErrorModel)
§type IntoIter = IntoIter<<ErrorModels as IntoIterator>::Item>
type IntoIter = IntoIter<<ErrorModels as IntoIterator>::Item>
§fn into_iter(self) -> <ErrorModels as IntoIterator>::IntoIter
fn into_iter(self) -> <ErrorModels as IntoIterator>::IntoIter
§impl Serialize for ErrorModels
impl Serialize for ErrorModels
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ErrorModels
impl RefUnwindSafe for ErrorModels
impl Send for ErrorModels
impl Sync for ErrorModels
impl Unpin for ErrorModels
impl UnwindSafe for ErrorModels
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> Context for T
impl<T> Context for T
fn vector_from_element<V>(&self, len: usize, value: <V as VectorCommon>::T) -> Vwhere
V: Vector<C = Self>,
fn vector_from_vec<V>(&self, vec: Vec<<V as VectorCommon>::T>) -> Vwhere
V: Vector<C = Self>,
fn vector_zeros<V>(&self, len: usize) -> Vwhere
V: Vector<C = Self>,
fn dense_mat_zeros<V>(
&self,
rows: usize,
cols: usize,
) -> <V as DefaultDenseMatrix>::Mwhere
V: Vector<C = Self> + DefaultDenseMatrix,
§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.