Trait Equation
pub trait Equation:
EquationPriv
+ 'static
+ Clone
+ Sync {
// Required method
fn estimate_likelihood(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_model: &ErrorModel,
cache: bool,
) -> Result<f64, PharmsolError>;
// Provided methods
fn estimate_predictions(
&self,
subject: &Subject,
support_point: &Vec<f64>,
) -> Result<Self::P, PharmsolError> { ... }
fn simulate_subject(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_model: Option<&ErrorModel>,
) -> 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_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>
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
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 simulate_subject(
&self,
subject: &Subject,
support_point: &Vec<f64>,
error_model: Option<&ErrorModel>,
) -> Result<(Self::P, Option<f64>), PharmsolError>
fn simulate_subject( &self, subject: &Subject, support_point: &Vec<f64>, error_model: Option<&ErrorModel>, ) -> 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.