class_docstr: Adapter for tensorflow-probability distributions.
docstr: Logarithmic probability density function.
  
  Numerically more stable than calling pdf and then taking logartihms.
  
  Let :math:`X` be a random variables with the distribution of `self`,
  taking values in `(N, n)` `DataFrame`-s
  Let :math:`x\in \mathbb{R}^{N\times n}`.
  By :math:`p_{X_{ij}}`, denote the marginal pdf of :math:`X` at the
  :math:`(i,j)`-th entry.
  
  The output of this method, for input `x` representing :math:`x`,
  is a `DataFrame` with same columns and indices as `self`,
  and entries :math:`\log p_{X_{ij}}(x_{ij})`.
  
  If `self` has a mixed or discrete distribution, this returns
  the weighted continuous part of `self`'s distribution instead of the pdf,
  i.e., the marginal pdf integrate to the weight of the continuous part.
  
  Parameters
  ----------
  x : `pandas.DataFrame` or 2D np.ndarray
      representing :math:`x`, as above
  
  Returns
  -------
  `DataFrame` with same columns and index as `self`
      containing :math:`\log p_{X_{ij}}(x_{ij})`, as above
docstr_tok: ["Logarithmic","probability","density","function",".","Numerically","more","stable","than","calling","pdf","and","then","taking","logartihms",".","Let",":","math",":","`","X","`","be","a","random","variables","with","the","distribution","of","`","self","`",",","taking","values","in","`","(","N",",","n",")","`","`","DataFrame","`","-s","Let",":","math",":","`","x\\in","\\mathbb","{","R","}","^","{","N\\times","n","}","`",".","By",":","math",":","`","p_","{","X_","{","ij","}","}","`",",","denote","the","marginal","pdf","of",":","math",":","`","X","`","at","the",":","math",":","`","(","i",",","j",")","`","-th","entry",".","The","output","of","this","method",",","for","input","`","x","`","representing",":","math",":","`","x","`",",","is","a","`","DataFrame","`","with","same","columns","and","indices","as","`","self","`",",","and","entries",":","math",":","`","\\log","p_","{","X_","{","ij","}","}","(","x_","{","ij","}",")","`",".","If","`","self","`","has","a","mixed","or","discrete","distribution",",","this","returns","the","weighted","continuous","part","of","`","self","`","'s","distribution","instead","of","the","pdf",",","i.e.",",","the","marginal","pdf","integrate","to","the","weight","of","the","continuous","part",".","Parameters","--","--","--","--","--","x",":","`","pandas.DataFrame","`","or","2D","np.ndarray","representing",":","math",":","`","x","`",",","as","above","Returns","--","--","--","-","`","DataFrame","`","with","same","columns","and","index","as","`","self","`","containing",":","math",":","`","\\log","p_","{","X_","{","ij","}","}","(","x_","{","ij","}",")","`",",","as","above"]
code: def log_pdf(self, x):
      r"""Logarithmic probability density function.
  
      Numerically more stable than calling pdf and then taking logartihms.
  
      Let :math:`X` be a random variables with the distribution of `self`,
      taking values in `(N, n)` `DataFrame`-s
      Let :math:`x\in \mathbb{R}^{N\times n}`.
      By :math:`p_{X_{ij}}`, denote the marginal pdf of :math:`X` at the
      :math:`(i,j)`-th entry.
  
      The output of this method, for input `x` representing :math:`x`,
      is a `DataFrame` with same columns and indices as `self`,
      and entries :math:`\log p_{X_{ij}}(x_{ij})`.
  
      If `self` has a mixed or discrete distribution, this returns
      the weighted continuous part of `self`'s distribution instead of the pdf,
      i.e., the marginal pdf integrate to the weight of the continuous part.
  
      Parameters
      ----------
      x : `pandas.DataFrame` or 2D np.ndarray
          representing :math:`x`, as above
  
      Returns
      -------
      `DataFrame` with same columns and index as `self`
          containing :math:`\log p_{X_{ij}}(x_{ij})`, as above
      """
      if isinstance(x, pd.DataFrame):
          dist_at_x = self.loc[x.index, x.columns]
          tensor = dist_at_x.distr.log_prob(x.values)
          return pd.DataFrame(tensor, index=x.index, columns=x.columns)
      else:
          dist_at_x = self
          return dist_at_x.distr.log_prob(x)
  
imports: from warnings import warn
  import numpy
  import pandas
  from sktime.base import BaseObject
  from sktime.utils.pandas import df_map
  from sktime.utils.validation._dependencies import _check_estimator_deps
label_desc: Use image node_id 4 for calling the _BaseTFDistribution obj's underlying member method code with example usage: obj.log_pdf(x) and returns: pd, dist_at_x