log_psi

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 simulation
  • subjects: The subject data
  • support_points: The support points to evaluate
  • error_model: The error model to use
  • progress: Whether to show a progress bar
  • cache: Whether to use caching

§Returns

A 2D array of log-likelihoods with shape (n_subjects, n_support_points)