Struct SDE
pub struct SDE { /* private fields */ }
Expand description
Stochastic Differential Equation solver for pharmacometric models.
This struct represents a stochastic differential equation system and provides methods to simulate particles and estimate likelihood for PKPD modeling.
SDE models introduce stochasticity into the system dynamics, allowing for more realistic modeling of biological variability and uncertainty.
Implementations§
§impl SDE
impl SDE
pub fn new(
drift: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: f64, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &Covariates),
diffusion: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>),
lag: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>) -> HashMap<usize, f64>,
fa: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>) -> HashMap<usize, f64>,
init: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: f64, _: &Covariates, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>),
out: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: f64, _: &Covariates, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>),
neqs: (usize, usize),
nparticles: usize,
) -> SDE
pub fn new( drift: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: f64, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &Covariates), diffusion: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), lag: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>) -> HashMap<usize, f64>, fa: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>) -> HashMap<usize, f64>, init: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: f64, _: &Covariates, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), out: fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: f64, _: &Covariates, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>), neqs: (usize, usize), nparticles: usize, ) -> SDE
Creates a new stochastic differential equation solver.
§Arguments
drift
- Function defining the deterministic component of the SDEdiffusion
- Function defining the stochastic component of the SDElag
- Function to compute absorption lag timesfa
- Function to compute bioavailability fractionsinit
- Function to initialize the system stateout
- Function to compute output equationsneqs
- Tuple containing the number of state and output equationsnparticles
- Number of particles to use in the simulation
§Returns
A new SDE solver instance configured with the given components.
Trait Implementations§
§impl Equation for SDE
impl Equation for SDE
§fn estimate_likelihood(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_model: &ErrorModel,
cache: bool,
) -> Result<f64, PharmsolError>
fn estimate_likelihood( &self, subject: &Subject, support_point: &Vec<f64>, error_model: &ErrorModel, cache: bool, ) -> Result<f64, PharmsolError>
Estimates the likelihood of observed data given a model and parameters.
§Arguments
subject
- Subject data containing observationssupport_point
- Parameter vector for the modelerror_model
- Error model to use for likelihood calculationscache
- Whether to cache likelihood results for reuse
§Returns
The log-likelihood of the observed data given the model and parameters.
Auto Trait Implementations§
impl Freeze for SDE
impl RefUnwindSafe for SDE
impl Send for SDE
impl Sync for SDE
impl Unpin for SDE
impl UnwindSafe for SDE
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> 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.