Struct Analytical
pub struct Analytical { /* private fields */ }Expand description
Model equation using analytical solutions.
This implementation uses closed-form analytical solutions for the model equations rather than numerical integration.
Implementations§
§impl Analytical
impl Analytical
pub fn new(
eq: fn(&NalgebraVec<f64>, &NalgebraVec<f64>, f64, &NalgebraVec<f64>, &Covariates) -> NalgebraVec<f64>,
seq_eq: fn(&mut NalgebraVec<f64>, f64, &Covariates),
lag: fn(&NalgebraVec<f64>, f64, &Covariates) -> HashMap<usize, f64>,
fa: fn(&NalgebraVec<f64>, f64, &Covariates) -> HashMap<usize, f64>,
init: fn(&NalgebraVec<f64>, f64, &Covariates, &mut NalgebraVec<f64>),
out: fn(&NalgebraVec<f64>, &NalgebraVec<f64>, f64, &Covariates, &mut NalgebraVec<f64>),
) -> Analytical
pub fn new( eq: fn(&NalgebraVec<f64>, &NalgebraVec<f64>, f64, &NalgebraVec<f64>, &Covariates) -> NalgebraVec<f64>, seq_eq: fn(&mut NalgebraVec<f64>, f64, &Covariates), lag: fn(&NalgebraVec<f64>, f64, &Covariates) -> HashMap<usize, f64>, fa: fn(&NalgebraVec<f64>, f64, &Covariates) -> HashMap<usize, f64>, init: fn(&NalgebraVec<f64>, f64, &Covariates, &mut NalgebraVec<f64>), out: fn(&NalgebraVec<f64>, &NalgebraVec<f64>, f64, &Covariates, &mut NalgebraVec<f64>), ) -> Analytical
Create a new Analytical equation model with default Neqs (all sizes = 5).
Use builder methods to configure dimensions:
ⓘ
Analytical::new(eq, seq_eq, lag, fa, init, out)
.with_nstates(2)
.with_ndrugs(1)
.with_nout(1)pub fn with_nstates(self, nstates: usize) -> Analytical
pub fn with_nstates(self, nstates: usize) -> Analytical
Set the number of state variables.
pub fn with_ndrugs(self, ndrugs: usize) -> Analytical
pub fn with_ndrugs(self, ndrugs: usize) -> Analytical
Set the number of drug input channels (size of bolus[] and rateiv[]).
pub fn with_nout(self, nout: usize) -> Analytical
pub fn with_nout(self, nout: usize) -> Analytical
Set the number of output equations.
Trait Implementations§
§impl Clone for Analytical
impl Clone for Analytical
§fn clone(&self) -> Analytical
fn clone(&self) -> Analytical
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for Analytical
impl Debug for Analytical
§impl Equation for Analytical
impl Equation for Analytical
§fn estimate_likelihood(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_models: &AssayErrorModels,
) -> Result<f64, PharmsolError>
fn estimate_likelihood( &self, subject: &Subject, support_point: &Vec<f64>, error_models: &AssayErrorModels, ) -> Result<f64, PharmsolError>
👎Deprecated since 0.23.0: Use estimate_log_likelihood() instead for better numerical stability
Estimate the likelihood of the subject given the support point and error model. Read more
§fn estimate_log_likelihood(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_models: &AssayErrorModels,
) -> Result<f64, PharmsolError>
fn estimate_log_likelihood( &self, subject: &Subject, support_point: &Vec<f64>, error_models: &AssayErrorModels, ) -> Result<f64, PharmsolError>
Estimate the log-likelihood of the subject given the support point and error model. Read more
fn kind() -> EqnKind
§fn estimate_predictions(
&self,
subject: &Subject,
support_point: &Vec<f64>,
) -> Result<Self::P, PharmsolError>
fn estimate_predictions( &self, subject: &Subject, support_point: &Vec<f64>, ) -> Result<Self::P, PharmsolError>
Generate predictions for a subject with given parameters. Read more
§fn simulate_subject(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_models: Option<&AssayErrorModels>,
) -> Result<(Self::P, Option<f64>), PharmsolError>
fn simulate_subject( &self, subject: &Subject, support_point: &Vec<f64>, error_models: Option<&AssayErrorModels>, ) -> Result<(Self::P, Option<f64>), PharmsolError>
Simulate a subject with given parameters and optionally calculate likelihood. Read more
§impl EquationTypes for Analytical
impl EquationTypes for Analytical
Auto Trait Implementations§
impl Freeze for Analytical
impl RefUnwindSafe for Analytical
impl Send for Analytical
impl Sync for Analytical
impl Unpin for Analytical
impl UnwindSafe for Analytical
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.