Activated LikelihoodEstimator instances in limits
@@ -368,16 +368,19 @@ class AsymptoticLimits(DataAnalyzer):
x=x_observed, theta=theta_grid, test_all_combinations=True, evaluate_score=False
)
elif isinstance(model, LikelihoodEstimator):
- raise NotImplementedError("LikelihoodEstimator is not implemented!")
+ log_r, _ = model.evaluate_log_likelihood(
+ x=x_observed, theta=theta_grid, test_all_combinations=True, evaluate_score=False
+ )
+ elif isinstance(model, Ensemble) and model.estimator_type == "parameterized_ratio":
log_r, _ = model.evaluate_log_likelihood_ratio(
x=x_observed,
- theta0=theta_grid,
- theta1=np.array(theta1),
+ theta=theta_grid,
test_all_combinations=True,
evaluate_score=False,
+ calculate_covariance=False,
)
- elif isinstance(model, Ensemble) and model.estimator_type == "parameterized_ratio":
- log_r, _ = model.evaluate_log_likelihood_ratio(
+ elif isinstance(model, Ensemble) and model.estimator_type == "likelihood":
+ log_r, _ = model.evaluate_log_likelihood(
x=x_observed,
theta=theta_grid,
test_all_combinations=True,
@@ -387,7 +390,7 @@ class AsymptoticLimits(DataAnalyzer):
else:
raise NotImplementedError(
"Likelihood ratio estimation is currently only implemented for "
- "ParameterizedRatioEstimator instancees"
+ "ParameterizedRatioEstimator and LikelihoodEstimator instancees"
)
return log_r
