docstr: Class for representing custom continuous distributions.
  
  Parameters
  ----------
  variables: list or array-like
      The variables for which the distribution is defined.
  
  distribution: function
      The probability density function of the distribution.
  
  Examples
  --------
  >>> import numpy as np
  >>> from scipy.special import beta
  >>> from pgmpy.factors.distributions import CustomDistribution
  # Two variable dirichlet distribution with alpha = (1, 2)
  >>> def dirichlet_pdf(x, y):
  ...     return (np.power(x, 1) * np.power(y, 2)) / beta(x, y)
  >>> dirichlet_dist = CustomDistribution(variables=['x', 'y'], distribution=dirichlet_pdf)
  >>> dirichlet_dist.variables
  ['x', 'y']
docstr_tok: ["Class","for","representing","custom","continuous","distributions",".","Parameters","--","--","--","--","--","variables",":","list","or","array-like","The","variables","for","which","the","distribution","is","defined",".","distribution",":","function","The","probability","density","function","of","the","distribution",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","scipy.special","import","beta",">",">",">","from","pgmpy.factors.distributions","import","CustomDistribution","#","Two","variable","dirichlet","distribution","with","alpha","=","(","1",",","2",")",">",">",">","def","dirichlet_pdf","(","x",",","y",")",":","...","return","(","np.power","(","x",",","1",")","*","np.power","(","y",",","2",")",")","\/","beta","(","x",",","y",")",">",">",">","dirichlet_dist","=","CustomDistribution","(","variables=","[","'","x","'",",","'","y","'","]",",","distribution=dirichlet_pdf",")",">",">",">","dirichlet_dist.variables","[","'","x","'",",","'","y","'","]"]
code: def __init__(self, variables, distribution, *args, **kwargs):
      """
      Class for representing custom continuous distributions.
  
      Parameters
      ----------
      variables: list or array-like
          The variables for which the distribution is defined.
  
      distribution: function
          The probability density function of the distribution.
  
      Examples
      --------
      >>> import numpy as np
      >>> from scipy.special import beta
      >>> from pgmpy.factors.distributions import CustomDistribution
      # Two variable dirichlet distribution with alpha = (1, 2)
      >>> def dirichlet_pdf(x, y):
      ...     return (np.power(x, 1) * np.power(y, 2)) / beta(x, y)
      >>> dirichlet_dist = CustomDistribution(variables=['x', 'y'], distribution=dirichlet_pdf)
      >>> dirichlet_dist.variables
      ['x', 'y']
      """
      if not isinstance(variables, (list, tuple, np.ndarray)):
          raise TypeError(
              f"variables: Expected type: iterable, got: {type(variables)}"
          )
  
      if len(set(variables)) != len(variables):
          raise ValueError(
              "Multiple variables can't have the same name"
          )
  
      self._variables = list(variables)
      self._pdf = distribution
  
imports: import numpy
  from scipy import integrate
  from pgmpy.factors.distributions import BaseDistribution
label_desc: Use image node_id 1 to create a new CustomDistribution object from inherited base classes: BaseDistribution with example: obj = CustomDistribution(variables, distribution)