diff --git a/petab_select/constants.py b/petab_select/constants.py index bba90ac..b56e8a4 100644 --- a/petab_select/constants.py +++ b/petab_select/constants.py @@ -141,6 +141,8 @@ class Criterion(str, Enum): LLH = "LLH" #: The negative log-likelihood. NLLH = "NLLH" + #: The sum of squared residuals. + SSR = "SSR" #: Methods that move through model space by taking steps away from some model. diff --git a/petab_select/model.py b/petab_select/model.py index d1c00c2..6c7602f 100644 --- a/petab_select/model.py +++ b/petab_select/model.py @@ -274,9 +274,11 @@ def compute_criterion( criterion_value = self.criterion_computer(criterion) self.set_criterion(criterion, criterion_value) result = criterion_value - except ValueError: + except ValueError as err: if raise_on_failure: - raise + raise ValueError( + f"Insufficient information to compute criterion `{criterion}`." + ) from err result = None return result @@ -684,6 +686,7 @@ def default_compare( Criterion.AICC, Criterion.BIC, Criterion.NLLH, + Criterion.SSR, ]: return ( model1.get_criterion(criterion)