From 2cccab62850b60e96bdd723697f19b163f2cde50 Mon Sep 17 00:00:00 2001 From: Sylvia Biscoveanu Date: Thu, 17 Oct 2024 13:11:07 -0700 Subject: [PATCH] Add null likelihood --- gwpopulation/hyperpe.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gwpopulation/hyperpe.py b/gwpopulation/hyperpe.py index cec9191f..74a600a9 100644 --- a/gwpopulation/hyperpe.py +++ b/gwpopulation/hyperpe.py @@ -495,3 +495,22 @@ def generate_rate_posterior_sample(self): this simply returns the current value of the rate parameter. """ return self.parameters["rate"] + + +class NullHyperparameterLikelihood(HyperparameterLikelihood): + """ + A likelihood that can be used to sample the prior space subject to the + maximum_uncertainty constraint imposed on the variance. + + For the uncertainty calculation see the Appendix of + `Golomb and Talbot `_ and + `Farr `_. + """ + + def ln_likelihood_and_variance(self): + """ + Compute the ln likelihood estimator and its variance. + """ + _, variance = super().ln_likelihood_and_variance() + return 0.0, variance +