Struct Occasion
pub struct Occasion { /* private fields */ }Expand description
An occasion within a subject’s dataset
An Occasion represents a distinct period of data collection for a subject, such as a hospital visit or dosing regimen. It contains events (doses, observations) and time-varying covariates.
Implementations§
§impl Occasion
impl Occasion
pub fn events(&self) -> &[Event]
pub fn events(&self) -> &[Event]
Get a vector of references to all events in this occasion
§Returns
A slice of all events in this occasion
pub fn add_covariate(&mut self, name: String, covariate: Covariate)
pub fn add_covariate(&mut self, name: String, covariate: Covariate)
Add a covariate to this occasion
§Arguments
name- Name of the covariatecovariate- The covariate to add
pub fn covariates(&self) -> &Covariates
pub fn covariates(&self) -> &Covariates
Get a reference to the covariates for this occasion
§Returns
Reference to the occasion’s covariates, if any
pub fn covariates_mut(&mut self) -> &mut Covariates
pub fn covariates_mut(&mut self) -> &mut Covariates
Get a mutable refernce to the covariates for this occasion
§Returns
Reference to the occasion’s covariates, if any
pub fn add_observation(
&mut self,
time: f64,
value: f64,
outeq: usize,
errorpoly: Option<ErrorPoly>,
censored: Censor,
)
pub fn add_observation( &mut self, time: f64, value: f64, outeq: usize, errorpoly: Option<ErrorPoly>, censored: Censor, )
Add an Observation event to the Occasion
pub fn add_missing_observation(&mut self, time: f64, outeq: usize)
pub fn add_missing_observation(&mut self, time: f64, outeq: usize)
Add a missing Observation event to the Occasion
pub fn add_observation_with_error(
&mut self,
time: f64,
value: f64,
outeq: usize,
errorpoly: ErrorPoly,
censored: Censor,
)
pub fn add_observation_with_error( &mut self, time: f64, value: f64, outeq: usize, errorpoly: ErrorPoly, censored: Censor, )
Add a missing Observation with a custom ErrorPoly to the Occasion
This is useful if you want a different weight for the observation
pub fn add_infusion(
&mut self,
time: f64,
amount: f64,
input: usize,
duration: f64,
)
pub fn add_infusion( &mut self, time: f64, amount: f64, input: usize, duration: f64, )
pub fn events_mut(&mut self) -> &mut Vec<Event>
pub fn events_mut(&mut self) -> &mut Vec<Event>
Get a mutable reference to the events
pub fn events_iter_mut(&mut self) -> IterMut<'_, Event>
pub fn events_iter_mut(&mut self) -> IterMut<'_, Event>
Get a mutable iterator to the events
§impl Occasion
impl Occasion
pub 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, overriding what is embedded in the occasion.
Use this when you want to supply or override dose amount, route, or infusion duration without modifying the underlying data.
Trait Implementations§
§impl<'de> Deserialize<'de> for Occasion
impl<'de> Deserialize<'de> for Occasion
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Occasion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Occasion, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<'a> IntoIterator for &'a Occasion
impl<'a> IntoIterator for &'a Occasion
§impl<'a> IntoIterator for &'a mut Occasion
impl<'a> IntoIterator for &'a mut Occasion
§impl IntoIterator for Occasion
impl IntoIterator for Occasion
§impl NCA for Occasion
impl NCA for Occasion
§fn nca(&self, options: &NCAOptions) -> Result<NCAResult, NCAError>
fn nca(&self, options: &NCAOptions) -> Result<NCAResult, NCAError>
§fn nca_all(&self, options: &NCAOptions) -> Vec<Result<NCAResult, NCAError>>
fn nca_all(&self, options: &NCAOptions) -> Vec<Result<NCAResult, NCAError>>
§impl ObservationMetrics for Occasion
impl ObservationMetrics for Occasion
§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>>
§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>>
§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>>
§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>>
§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>>
§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>>
§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>>
§fn auc(
&self,
outeq: usize,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn auc( &self, outeq: usize, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
§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>>
§fn aumc(
&self,
outeq: usize,
method: &AUCMethod,
) -> Vec<Result<f64, MetricsError>>
fn aumc( &self, outeq: usize, method: &AUCMethod, ) -> Vec<Result<f64, MetricsError>>
§fn auc_first(
&self,
outeq: usize,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn auc_first( &self, outeq: usize, method: &AUCMethod, ) -> Result<f64, MetricsError>
§fn cmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn cmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn tmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn tmax_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn clast_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn clast_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn tlast_first(&self, outeq: usize) -> Result<f64, MetricsError>
fn tlast_first(&self, outeq: usize) -> Result<f64, MetricsError>
§fn aumc_first(
&self,
outeq: usize,
method: &AUCMethod,
) -> Result<f64, MetricsError>
fn aumc_first( &self, outeq: usize, method: &AUCMethod, ) -> Result<f64, MetricsError>
§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>
§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>
§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>
§fn auc_interval_blq_first(
&self,
outeq: usize,
start: f64,
end: f64,
method: &AUCMethod,
blq_rule: &BLQRule,
) -> Result<f64, MetricsError>
fn auc_interval_blq_first( &self, outeq: usize, start: f64, end: f64, method: &AUCMethod, blq_rule: &BLQRule, ) -> Result<f64, MetricsError>
§impl Serialize for Occasion
impl Serialize for Occasion
§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 Superposition for Occasion
impl Superposition for Occasion
§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 Occasion
impl RefUnwindSafe for Occasion
impl Send for Occasion
impl Sync for Occasion
impl Unpin for Occasion
impl UnwindSafe for Occasion
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.