code: def create_objective(dist, abscissas):
      
      abscissas_ = numpy.array(abscissas[1:-1])
      def obj(absisa):
          """Local objective function."""
          out = -numpy.sqrt(dist.pdf(absisa))
          out *= numpy.prod(numpy.abs(abscissas_ - absisa))
          return out
      return obj
docs: Create objective function.