From a8c3a7ef05ab5dc7daf1a012fa87e3a45b7d857a Mon Sep 17 00:00:00 2001 From: Knut Dundas Moraa Date: Thu, 10 Aug 2023 14:05:15 -0400 Subject: [PATCH 1/2] Set best_fit_args to confidence_interval_args if None --- alea/model.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/alea/model.py b/alea/model.py index e33a9c47..62ba88c2 100644 --- a/alea/model.py +++ b/alea/model.py @@ -396,8 +396,8 @@ def confidence_interval( parameter_interval_bounds: Tuple[float, float] = None, confidence_level: float = None, confidence_interval_kind: str = None, - best_fit_args: dict = None, confidence_interval_args: dict = None, + best_fit_args: dict = None, ) -> Tuple[float, float]: """ Uses self.fit to compute confidence intervals for a certain named parameter. @@ -421,15 +421,17 @@ def confidence_interval( If None, the default kind of the model is used. Keyword Args: - best_fit_args: the parameters to **only** get the global best-fit likelihood - confidence_interval_args: the parameters to get the profile-likelihood, - also the best-fit parameters of profile-likelihood, - parameter_interval_bounds, and confidence interval + confidence_interval_args (dict, optional (default=None)): Parameters that will be fixed + in the profile likelihood computation. If None, all fittable parameters will be profiled except the poi + best_fit_args (dict, optional (default=None)): If you require the "global" best-fit used to normalise the + profile likelihood ratio to fix fewer parameters than the profile likelihood-- mainly used for 1-D slices + of higher-dimensional confidence volumes, where the global best-fit may not be along the profile. + if None, will be set to confidence_interval_args """ - if best_fit_args is None: - best_fit_args = {} if confidence_interval_args is None: confidence_interval_args = {} + if best_fit_args is None: + best_fit_args = confidence_interval_args ci_objects = self._confidence_interval_checks( poi_name, parameter_interval_bounds, From ead88b51f38363fda10c51b18b61a9be7d844351 Mon Sep 17 00:00:00 2001 From: Knut Dundas Moraa Date: Thu, 10 Aug 2023 15:10:24 -0400 Subject: [PATCH 2/2] spaces for Dacheng --- alea/model.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/alea/model.py b/alea/model.py index 62ba88c2..856a63ce 100644 --- a/alea/model.py +++ b/alea/model.py @@ -422,11 +422,11 @@ def confidence_interval( Keyword Args: confidence_interval_args (dict, optional (default=None)): Parameters that will be fixed - in the profile likelihood computation. If None, all fittable parameters will be profiled except the poi + in the profile likelihood computation. If None, all fittable parameters will be profiled except the poi best_fit_args (dict, optional (default=None)): If you require the "global" best-fit used to normalise the - profile likelihood ratio to fix fewer parameters than the profile likelihood-- mainly used for 1-D slices - of higher-dimensional confidence volumes, where the global best-fit may not be along the profile. - if None, will be set to confidence_interval_args + profile likelihood ratio to fix fewer parameters than the profile likelihood-- mainly used for 1-D slices + of higher-dimensional confidence volumes, where the global best-fit may not be along the profile. + if None, will be set to confidence_interval_args """ if confidence_interval_args is None: confidence_interval_args = {}