def get_likelihood_function(self, params):
        if self.LL_det is None:
            raise RuntimeError("Must call DeterministicInference.setup_likelihood_function before using DeterministicInference.get_likelihood_function.")
        #this part is the only part that is called repeatedly
        params_dict = {}
        for key, p in zip(self.params_to_estimate, params):
            params_dict[key] = p
        self.LL_det.set_init_params(params_dict)

        # Check prior
        lp = 0
        lp = self.check_prior(params_dict)
        if not np.isfinite(lp):
            return -np.inf

        #apply cost function
        LL_det_cost = self.LL_det.py_log_likelihood()
        ln_prob = lp + LL_det_cost
        return ln_prob