Enum AssayErrorModel
pub enum AssayErrorModel {
Additive {
lambda: Factor,
poly: ErrorPoly,
},
Proportional {
gamma: Factor,
poly: ErrorPoly,
},
None,
}Expand description
Model for calculating observation errors in pharmacometric analyses
An AssayErrorModel defines how the standard deviation of observations is calculated based on the type of error model used and its parameters.
Variants§
Additive
Additive error model, where error is independent of concentration
Contains:
lambda- Lambda parameter for scaling errors (can be fixed or variable)poly- Error polynomial coefficients (c0, c1, c2, c3)
Fields
Proportional
Proportional error model, where error scales with concentration
Contains:
gamma- Gamma parameter for scaling errors (can be fixed or variable)poly- Error polynomial coefficients (c0, c1, c2, c3)
Fields
None
Implementations§
§impl AssayErrorModel
impl AssayErrorModel
pub fn additive(poly: ErrorPoly, lambda: f64) -> AssayErrorModel
pub fn additive(poly: ErrorPoly, lambda: f64) -> AssayErrorModel
pub fn additive_fixed(poly: ErrorPoly, lambda: f64) -> AssayErrorModel
pub fn additive_fixed(poly: ErrorPoly, lambda: f64) -> AssayErrorModel
pub fn additive_with_param(poly: ErrorPoly, lambda: Factor) -> AssayErrorModel
pub fn additive_with_param(poly: ErrorPoly, lambda: Factor) -> AssayErrorModel
pub fn proportional(poly: ErrorPoly, gamma: f64) -> AssayErrorModel
pub fn proportional(poly: ErrorPoly, gamma: f64) -> AssayErrorModel
pub fn proportional_fixed(poly: ErrorPoly, gamma: f64) -> AssayErrorModel
pub fn proportional_fixed(poly: ErrorPoly, gamma: f64) -> AssayErrorModel
pub fn proportional_with_param(
poly: ErrorPoly,
gamma: Factor,
) -> AssayErrorModel
pub fn proportional_with_param( poly: ErrorPoly, gamma: Factor, ) -> AssayErrorModel
pub fn errorpoly(&self) -> Result<ErrorPoly, ErrorModelError>
pub fn errorpoly(&self) -> Result<ErrorPoly, ErrorModelError>
pub fn set_errorpoly(&mut self, poly: ErrorPoly)
pub fn set_errorpoly(&mut self, poly: ErrorPoly)
pub fn factor(&self) -> Result<f64, ErrorModelError>
pub fn factor(&self) -> Result<f64, ErrorModelError>
Get the scaling parameter value
pub fn set_factor(&mut self, factor: f64)
pub fn set_factor(&mut self, factor: f64)
Set the scaling parameter value (preserves fixed/variable state)
pub fn factor_param(&self) -> Result<Factor, ErrorModelError>
pub fn factor_param(&self) -> Result<Factor, ErrorModelError>
Get the scaling parameter (including its fixed/variable state)
pub fn set_factor_param(&mut self, param: Factor)
pub fn set_factor_param(&mut self, param: Factor)
Set the scaling parameter (including its fixed/variable state)
pub fn is_factor_fixed(&self) -> Result<bool, ErrorModelError>
pub fn is_factor_fixed(&self) -> Result<bool, ErrorModelError>
Check if the scaling parameter is fixed
pub fn fix_factor(&mut self)
pub fn fix_factor(&mut self)
Make the scaling parameter fixed at its current value
pub fn unfix_factor(&mut self)
pub fn unfix_factor(&mut self)
Make the scaling parameter variable at its current value
pub fn is_proportional(&self) -> bool
pub fn is_proportional(&self) -> bool
Check if this is a proportional error model
§Returns
true if this is a Proportional variant, false otherwise
pub fn is_additive(&self) -> bool
pub fn is_additive(&self) -> bool
Check if this is an additive error model
§Returns
true if this is an Additive variant, false otherwise
pub fn sigma(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
pub fn sigma(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
Estimate the standard deviation for a prediction
Calculates the standard deviation based on the error model type, using either observation-specific error polynomial coefficients or the model’s default coefficients.
§Arguments
prediction- The prediction for which to estimate the standard deviation
§Returns
The estimated standard deviation of the prediction
pub fn variance(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
pub fn variance(&self, prediction: &Prediction) -> Result<f64, ErrorModelError>
Estimate the variance of the observation
This is a convenience function which calls AssayErrorModel::sigma, and squares the result.
pub fn sigma_from_value(&self, value: f64) -> Result<f64, ErrorModelError>
pub fn sigma_from_value(&self, value: f64) -> Result<f64, ErrorModelError>
Estimate the standard deviation for a raw observation value
Calculates the standard deviation based on the error model type, using the model’s default coefficients and a provided observation value.
§Arguments
value- The observation value for which to estimate the standard deviation
§Returns
The estimated standard deviation for the given value
pub fn variance_from_value(&self, value: f64) -> Result<f64, ErrorModelError>
pub fn variance_from_value(&self, value: f64) -> Result<f64, ErrorModelError>
Estimate the variance for a raw observation value
This is a convenience function which calls AssayErrorModel::sigma_from_value, and squares the result.
Trait Implementations§
§impl Clone for AssayErrorModel
impl Clone for AssayErrorModel
§fn clone(&self) -> AssayErrorModel
fn clone(&self) -> AssayErrorModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for AssayErrorModel
impl Debug for AssayErrorModel
§impl Default for AssayErrorModel
impl Default for AssayErrorModel
§fn default() -> AssayErrorModel
fn default() -> AssayErrorModel
§impl<'de> Deserialize<'de> for AssayErrorModel
impl<'de> Deserialize<'de> for AssayErrorModel
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AssayErrorModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AssayErrorModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for AssayErrorModel
impl PartialEq for AssayErrorModel
§impl Serialize for AssayErrorModel
impl Serialize for AssayErrorModel
§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,
impl StructuralPartialEq for AssayErrorModel
Auto Trait Implementations§
impl Freeze for AssayErrorModel
impl RefUnwindSafe for AssayErrorModel
impl Send for AssayErrorModel
impl Sync for AssayErrorModel
impl Unpin for AssayErrorModel
impl UnwindSafe for AssayErrorModel
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.