pub struct Subject { /* private fields */ }Expand description
A subject in a pharmacometric dataset
A Subject represents a single individual with one or more occasions of data, each containing events (doses, observations) and covariates.
Implementations§
Source§impl Subject
impl Subject
Sourcepub fn occasions(&self) -> &[Occasion]
pub fn occasions(&self) -> &[Occasion]
Get a vector of references to all occasions for this subject
§Returns
A slice of all occasions for this subject
Sourcepub fn from_occasions(id: String, occasions: Vec<Occasion>) -> Self
pub fn from_occasions(id: String, occasions: Vec<Occasion>) -> Self
Create a new subject from one or more occasions
This is useful when you want to create a subject from specific occasions rather than building it completely from scratch.
§Arguments
id- The subject identifieroccasions- Vector of occasions to include in this subject
§Returns
A new subject containing the specified occasions
Sourcepub fn occasions_mut(&mut self) -> &mut Vec<Occasion>
pub fn occasions_mut(&mut self) -> &mut Vec<Occasion>
Iterate over a mutable reference to the occasions
Sourcepub fn occasions_iter_mut(&mut self) -> IterMut<'_, Occasion>
pub fn occasions_iter_mut(&mut self) -> IterMut<'_, Occasion>
Get a mutable iterator to the occasions
pub fn get_output_equations(&self) -> Vec<usize>
Sourcepub fn get_occasion_mut(&mut self, index: usize) -> Option<&mut Occasion>
pub fn get_occasion_mut(&mut self, index: usize) -> Option<&mut Occasion>
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, Occasion>
pub fn iter_mut(&mut self) -> IterMut<'_, Occasion>
Get a mutable iterator over all occasions
§Returns
A mutable iterator yielding references to occasions
Sourcepub fn hash(&self) -> u64
pub fn hash(&self) -> u64
Calculate the hash for a subject
The hash takes into account all events, so that if a subject is modified, it will not produce the same likelihood when simulated with the same support point. Note that covariates are not included in the hash, but a method exists to hash covariates if needed.
Source§impl Subject
impl Subject
Sourcepub fn nca_with_dose(
&self,
dose_amount: f64,
route: Route,
infusion_duration: Option<f64>,
options: &NCAOptions,
) -> Result<NCAResult, NCAError>
pub fn nca_with_dose( &self, dose_amount: f64, route: Route, infusion_duration: Option<f64>, options: &NCAOptions, ) -> Result<NCAResult, NCAError>
Run NCA with an explicit dose on the first occasion, overriding what is embedded in the subject’s events.
Use this when you want to supply or override dose amount, route, or infusion duration without modifying the underlying data.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subject
impl<'de> Deserialize<'de> for Subject
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a> IntoIterator for &'a Subject
impl<'a> IntoIterator for &'a Subject
Source§impl<'a> IntoIterator for &'a mut Subject
impl<'a> IntoIterator for &'a mut Subject
Source§impl IntoIterator for Subject
impl IntoIterator for Subject
Source§impl ObservationMetrics for Subject
impl ObservationMetrics for Subject
Source§fn auc_blq(
&self,
outeq: usize,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn auc_blq( &self, outeq: usize, method: &AUCMethod, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
Source§fn auc_interval_blq(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn auc_interval_blq( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
Source§fn cmax_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn cmax_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
Source§fn tmax_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn tmax_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
Source§fn clast_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn clast_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
Source§fn tlast_blq(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn tlast_blq( &self, outeq: usize, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
Source§fn aumc_blq(
&self,
outeq: usize,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Vec<Result<f64, MetricsError>>
fn aumc_blq( &self, outeq: usize, method: &AUCMethod, blq_rule: &BLQRule, ) -> Vec<Result<f64, MetricsError>>
Source§fn auc(
&self,
outeq: usize,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn auc( &self, outeq: usize, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
Source§fn auc_interval(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn auc_interval( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
Source§fn aumc(
&self,
outeq: usize,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn aumc( &self, outeq: usize, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
Source§fn auc_first(
&self,
outeq: usize,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn auc_first( &self, outeq: usize, method: &AUCMethod, ) -> Result<f64, MetricsError>
Source§fn cmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn cmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
Source§fn tmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn tmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
Source§fn clast_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn clast_first(&self, outeq: usize) -> Result<f64, MetricsError>
Source§fn tlast_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn tlast_first(&self, outeq: usize) -> Result<f64, MetricsError>
Source§fn aumc_first(
&self,
outeq: usize,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn aumc_first( &self, outeq: usize, method: &AUCMethod, ) -> Result<f64, MetricsError>
Source§fn auc_interval_first(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn auc_interval_first( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, ) -> Result<f64, MetricsError>
Source§fn auc_blq_first(
&self,
outeq: usize,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Result<f64, MetricsError>
fn auc_blq_first( &self, outeq: usize, method: &AUCMethod, blq_rule: &BLQRule, ) -> Result<f64, MetricsError>
Source§fn cmax_blq_first(
&self,
outeq: usize,
blq_rule: &BLQRule,
) -> Result<f64, MetricsError>
fn cmax_blq_first( &self, outeq: usize, blq_rule: &BLQRule, ) -> Result<f64, MetricsError>
Source§impl SubjectBuilderExt for Subject
impl SubjectBuilderExt for Subject
Source§impl Superposition for Subject
impl Superposition for Subject
Source§fn superposition(
&self,
tau: f64,
options: &NCAOptions,
n_eval_points: Option<usize>,
) -> Result<SuperpositionResult, NCAError>
fn superposition( &self, tau: f64, options: &NCAOptions, n_eval_points: Option<usize>, ) -> Result<SuperpositionResult, NCAError>
Auto Trait Implementations§
impl Freeze for Subject
impl RefUnwindSafe for Subject
impl Send for Subject
impl Sync for Subject
impl Unpin for Subject
impl UnwindSafe for Subject
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.