code: def likelihood_data_given_model(self, kwargs_lens, kwargs_source, kwargs_lens_light, kwargs_ps, source_marg=False):
          
          # generate image
          im_sim_list, model_error_list, cov_matrix, param = self.image_linear_solve(kwargs_lens, kwargs_source,
                                                                           kwargs_lens_light, kwargs_ps,
                                                                           inv_bool=source_marg)
          # compute X^2
          logL = 0
          index = 0
          for i in range(self._num_bands):
              if self._compute_bool[i] is True:
                  logL += self._imageModel_list[i].Data.log_likelihood(im_sim_list[index], self._imageModel_list[i].ImageNumerics.mask, model_error_list[index])
                  index += 1
          if cov_matrix is not None and source_marg:
              marg_const = de_lens.marginalisation_const(cov_matrix)
              logL += marg_const
          return logL
docs: computes the likelihood of the data given a model
          This is specified with the non-linear parameters and a linear inversion and prior marginalisation.
          :param kwargs_lens:
          :param kwargs_source:
          :param kwargs_lens_light:
          :param kwargs_ps:
          :return: log likelihood (natural logarithm) (sum of the log likelihoods of the individual images)