Trait Equation
pub trait Equation:
EquationPriv
+ 'static
+ Clone
+ Sync {
// Required methods
fn estimate_likelihood(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_models: &ErrorModels,
cache: bool,
) -> Result<f64, PharmsolError>;
fn kind() -> EqnKind;
fn mappings_ref(&self) -> Option<&Mappings>;
fn mappings_mut(&mut self) -> &mut Mappings;
// Provided methods
fn estimate_predictions(
&self,
subject: &Subject,
support_point: &Vec<f64>,
) -> Result<Self::P, PharmsolError> { ... }
fn nouteqs(&self) -> usize { ... }
fn nstates(&self) -> usize { ... }
fn add_mapping(
&mut self,
input: usize,
cmt: usize,
) -> Result<(), PharmsolError> { ... }
fn simulate_subject(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_models: Option<&ErrorModels>,
) -> Result<(Self::P, Option<f64>), PharmsolError> { ... }
}
Expand description
Trait for model equations that can be simulated.
This trait defines the interface for different types of model equations (ODE, SDE, analytical) that can be simulated to generate predictions and estimate parameters.
Required Methods§
fn estimate_likelihood(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_models: &ErrorModels,
cache: bool,
) -> Result<f64, PharmsolError>
fn estimate_likelihood( &self, subject: &Subject, support_point: &Vec<f64>, error_models: &ErrorModels, cache: bool, ) -> Result<f64, PharmsolError>
Estimate the likelihood of the subject given the support point and error model.
This function calculates how likely the observed data is given the model parameters and error model. It may use caching for performance.
§Parameters
subject
: The subject datasupport_point
: The parameter valueserror_model
: The error modelcache
: Whether to use caching
§Returns
The log-likelihood value
fn kind() -> EqnKind
fn mappings_ref(&self) -> Option<&Mappings>
fn mappings_ref(&self) -> Option<&Mappings>
Returns the mappings (input -> cmt) if present.
fn mappings_mut(&mut self) -> &mut Mappings
fn mappings_mut(&mut self) -> &mut Mappings
Returns a mutable reference to the mappings if present.
Provided Methods§
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>
fn add_mapping(&mut self, input: usize, cmt: usize) -> Result<(), PharmsolError>
fn add_mapping(&mut self, input: usize, cmt: usize) -> Result<(), PharmsolError>
Add an new element to the mapper.
fn simulate_subject(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_models: Option<&ErrorModels>,
) -> Result<(Self::P, Option<f64>), PharmsolError>
fn simulate_subject( &self, subject: &Subject, support_point: &Vec<f64>, error_models: Option<&ErrorModels>, ) -> Result<(Self::P, Option<f64>), PharmsolError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.