docstr: Given a Normal distribution for the latent function, and a datum Y,
  compute the log predictive density of Y.
  
  i.e. if
      q(x, f) = N(Fmu, Fvar)
  
  and this object represents
  
      p(y|x,f)
  
  then this method computes the predictive density
  
      log ∫ p(y=Y|x,f)q(x,f) df
  
  Here, we implement a default Monte Carlo routine.
docstr_tok: ["Given","a","Normal","distribution","for","the","latent","function",",","and","a","datum","Y",",","compute","the","log","predictive","density","of","Y.","i.e",".","if","q","(","x",",","f",")","=","N","(","Fmu",",","Fvar",")","and","this","object","represents","p","(","y|x",",","f",")","then","this","method","computes","the","predictive","density","log","\u222b","p","(","y=Y|x",",","f",")","q","(","x",",","f",")","df","Here",",","we","implement","a","default","Monte","Carlo","routine","."]
code: def _predict_log_density(
      self,
      X: TensorType,
      Fmu: TensorType,
      Fvar: TensorType,
      Y: TensorType,
      epsilon: Optional[TensorType] = None,
  ) -> tf.Tensor:
      r"""
      Given a Normal distribution for the latent function, and a datum Y,
      compute the log predictive density of Y.
  
      i.e. if
          q(x, f) = N(Fmu, Fvar)
  
      and this object represents
  
          p(y|x,f)
  
      then this method computes the predictive density
  
          log ∫ p(y=Y|x,f)q(x,f) df
  
      Here, we implement a default Monte Carlo routine.
      """
  
      def log_prob(
          F: TensorType, X_: TensorType, Y_: TensorType
      ) -> tf.Tensor:
          return self.log_prob(X_, F, Y_)
  
      return tf.reduce_sum(
          self._mc_quadrature(
              log_prob,
              Fmu,
              Fvar,
              logspace=True,
              epsilon=epsilon,
              X_=X,
              Y_=Y,
          ),
          axis=-1,
      )
  
imports: import abc
  from typing import Any, Callable, Iterable, Optional, Sequence, Union
  import tensorflow
  from check_shapes import check_shapes, inherit_check_shapes
  from ..base import MeanAndVariance, Module, TensorType
  from ..quadrature import GaussianQuadrature, NDiagGHQuadrature, ndiag_mc
label_desc: Use image node_id 4 for calling the MonteCarloLikelihood obj's underlying member method code with example usage: obj._predict_log_density(X, Fmu, Fvar, Y, epsilon) and returns: tf, self