code: def truncated_normal_log_likelihood(params, low, high, data):
          
          mu = params[0]
          sigma = params[1]
          if sigma == 0:
              return np.inf
          ll = np.sum(norm.logpdf(data, mu, sigma))
          ll -= len(data) * np.log((norm.cdf(high, mu, sigma) - norm.cdf(low, mu, sigma)))
          return -ll
docs: Calculate the log likelihood of the truncated normal distribution.
  
          Args:
              params: tuple with (mean, std), the parameters under which we evaluate the model
              low (float): the lower truncation bound
              high (float): the upper truncation bound
              data (ndarray): the one dimension list of data points for which we want to calculate the likelihood
  
          Returns:
              float: the negative log likelihood of observing the given data under the given parameters.
                  This is meant to be used in minimization routines.