code: def max_neg_logprob(op, values, base_var, **kwargs):
      r"""Compute the log-likelihood graph for the `Max` operation.
      The formula that we use here is :
          \ln(f_{(n)}(x)) = \ln(n) + (n-1) \ln(1 - F(x)) + \ln(f(x))
      where f(x) represents the p.d.f and F(x) represents the c.d.f of the distribution respectively.
      """
      (value,) = values
      base_rv = base_var.owner.inputs[0]
  
      logprob = _logprob_helper(base_rv, -value)
      logcdf = _logcdf_helper(base_rv, -value)
  
      [n] = constant_fold([base_rv.size])
      logprob = (
          (n - 1) * pt.math.log(1 - pt.math.exp(logcdf))
          + logprob
          + pt.math.log(n)
      )
  
      return logprob
  
imports: from typing import List, Optional
  import pytensor.tensor
  from pytensor.graph.basic import Node
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.rewriting.basic import node_rewriter
  from pytensor.scalar.basic import Mul
  from pytensor.tensor.basic import get_underlying_scalar_constant_value
  from pytensor.tensor.elemwise import Elemwise
  from pytensor.tensor.exceptions import NotScalarConstantError
  from pytensor.tensor.math import Max
  from pytensor.tensor.random.op import RandomVariable
  from pytensor.tensor.variable import TensorVariable
  from pymc.logprob.abstract import MeasurableVariable, _logcdf_helper, _logprob, _logprob_helper
  from pymc.logprob.rewriting import measurable_ir_rewrites_db
  from pymc.math import logdiffexp
  from pymc.pytensorf import constant_fold
label_desc: Use image node_id 5 for calling a global function with example usage: max_neg_logprob(op, values, base_var) and returns: logprob