class_docstr: The intermediate factors in a Gaussian network can be described
  compactly using a simple parametric representation called the
  canonical form. This representation is closed under the basic
  operations used in inference: factor product, factor division,
  factor reduction, and marginalization. Thus, we define this
  CanonicalDistribution class that allows the inference process to be
  performed on joint Gaussian networks.
  
  A canonical form C (X; K,h,g) is defined as
  
  C (X; K,h,g) = exp( ((-1/2) * X.T * K * X) + (h.T * X) + g)
  
  References
  ----------
  Probabilistic Graphical Models, Principles and Techniques,
  Daphne Koller and Nir Friedman, Section 14.2, Chapter 14.
class_docstr_tok: ["The","intermediate","factors","in","a","Gaussian","network","can","be","described","compactly","using","a","simple","parametric","representation","called","the","canonical","form",".","This","representation","is","closed","under","the","basic","operations","used","in","inference",":","factor","product",",","factor","division",",","factor","reduction",",","and","marginalization",".","Thus",",","we","define","this","CanonicalDistribution","class","that","allows","the","inference","process","to","be","performed","on","joint","Gaussian","networks",".","A","canonical","form","C","(","X\u037e","K",",","h",",","g",")","is","defined","as","C","(","X\u037e","K",",","h",",","g",")","=","exp","(","(","(","-1\/2",")","*","X.T","*","K","*","X",")","+","(","h.T","*","X",")","+","g",")","References","--","--","--","--","--","Probabilistic","Graphical","Models",",","Principles","and","Techniques",",","Daphne","Koller","and","Nir","Friedman",",","Section","14.2",",","Chapter","14","."]
docstr: Makes a copy of the factor.
  
  Returns
  -------
  CanonicalDistribution object: Copy of the factor
  
  Examples
  --------
  >>> from pgmpy.factors.continuous import CanonicalDistribution
  >>> phi = CanonicalDistribution(['X', 'Y'], np.array([[1, -1], [-1, 1]]),
                            np.array([[1], [-1]]), -3)
  >>> phi.variables
  ['X', 'Y']
  
  >>> phi.K
  array([[1, -1],
         [-1, 1]])
  
  >>> phi.h
  array([[1],
         [-1]])
  
  >>> phi.g
  -3
  
  >>> phi2 = phi.copy()
  
  >>> phi2.variables
  ['X', 'Y']
  
  >>> phi2.K
  array([[1, -1],
         [-1, 1]])
  
  >>> phi2.h
  array([[1],
         [-1]])
  
  >>> phi2.g
  -3
docstr_tok: ["Makes","a","copy","of","the","factor",".","Returns","--","--","--","-","CanonicalDistribution","object",":","Copy","of","the","factor","Examples","--","--","--","--",">",">",">","from","pgmpy.factors.continuous","import","CanonicalDistribution",">",">",">","phi","=","CanonicalDistribution","(","[","'","X","'",",","'","Y","'","]",",","np.array","(","[","[","1",",","-1","]",",","[","-1",",","1","]","]",")",",","np.array","(","[","[","1","]",",","[","-1","]","]",")",",","-3",")",">",">",">","phi.variables","[","'","X","'",",","'","Y","'","]",">",">",">","phi.K","array","(","[","[","1",",","-1","]",",","[","-1",",","1","]","]",")",">",">",">","phi.h","array","(","[","[","1","]",",","[","-1","]","]",")",">",">",">","phi.g","-3",">",">",">","phi2","=","phi.copy","(",")",">",">",">","phi2.variables","[","'","X","'",",","'","Y","'","]",">",">",">","phi2.K","array","(","[","[","1",",","-1","]",",","[","-1",",","1","]","]",")",">",">",">","phi2.h","array","(","[","[","1","]",",","[","-1","]","]",")",">",">",">","phi2.g","-3"]
code: def copy(self):
      """
      Makes a copy of the factor.
  
      Returns
      -------
      CanonicalDistribution object: Copy of the factor
  
      Examples
      --------
      >>> from pgmpy.factors.continuous import CanonicalDistribution
      >>> phi = CanonicalDistribution(['X', 'Y'], np.array([[1, -1], [-1, 1]]),
                                np.array([[1], [-1]]), -3)
      >>> phi.variables
      ['X', 'Y']
  
      >>> phi.K
      array([[1, -1],
             [-1, 1]])
  
      >>> phi.h
      array([[1],
             [-1]])
  
      >>> phi.g
      -3
  
      >>> phi2 = phi.copy()
  
      >>> phi2.variables
      ['X', 'Y']
  
      >>> phi2.K
      array([[1, -1],
             [-1, 1]])
  
      >>> phi2.h
      array([[1],
             [-1]])
  
      >>> phi2.g
      -3
  
      """
      copy_factor = CanonicalDistribution(
          self.variables, self.K.copy(), self.h.copy(), self.g
      )
  
      return copy_factor
  
file_path: pgmpy/pgmpy/factors/distributions/CanonicalDistribution.py
imports: import numpy
  from pgmpy.factors.distributions import BaseDistribution
  from pgmpy.factors.distributions import GaussianDistribution
label_desc: Use image node_id 4 for calling the CanonicalDistribution obj's underlying member method code with example usage: obj.copy() and returns: copy_factor