Function log_psi
pub fn log_psi(
equation: &impl Equation,
subjects: &Data,
support_points: &ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>,
error_models: &ErrorModels,
progress: bool,
cache: bool,
) -> Result<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, PharmsolError>Expand description
Calculate the log-likelihood matrix for all subjects and support points.
This function computes log-likelihoods directly in log-space, which is numerically more stable than computing likelihoods and then taking logarithms. This is especially important when dealing with many observations or extreme parameter values that could cause the regular likelihood to underflow to zero.
§Parameters
equation: The equation to use for simulationsubjects: The subject datasupport_points: The support points to evaluateerror_model: The error model to useprogress: Whether to show a progress barcache: Whether to use caching
§Returns
A 2D array of log-likelihoods with shape (n_subjects, n_support_points)