class_docstr: For, X -> Y the Linear Gaussian model assumes that the mean
  of Y is a linear function of mean of X and the variance of Y does
  not depend on X.
  
  For example,
  
  .. math::
  
    p(Y|X) = N(-2x + 0.9 ; 1)
  
  Here, :math:`x` is the mean of the variable :math:`X`.
  
  Let :math:`Y` be a continuous variable with continuous parents
  :math:`X1, X2, \cdots, Xk`. We say that :math:`Y` has a linear Gaussian CPD
  if there are parameters :math:`\beta_0, \beta_1, ..., \beta_k`
  and :math:`\sigma_2` such that,
  
  .. math:: p(Y |x1, x2, ..., xk) = \mathcal{N}(\beta_0 + x1*\beta_1 + ......... + xk*\beta_k ; \sigma_2)
  
  In vector notation,
  
  .. math:: p(Y |x) = \mathcal{N}(\beta_0 + \boldmath{β}.T * \boldmath{x} ; \sigma_2)
  
  References
  ----------
  .. [1] https://cedar.buffalo.edu/~srihari/CSE574/Chap8/Ch8-PGM-GaussianBNs/8.5%20GaussianBNs.pdf
class_docstr_tok: ["For",",","X","-",">","Y","the","Linear","Gaussian","model","assumes","that","the","mean","of","Y","is","a","linear","function","of","mean","of","X","and","the","variance","of","Y","does","not","depend","on","X",".","For","example",",","..","math",":",":","p","(","Y|X",")","=","N","(","-2x","+","0.9",";","1",")","Here",",",":","math",":","`","x","`","is","the","mean","of","the","variable",":","math",":","`","X","`",".","Let",":","math",":","`","Y","`","be","a","continuous","variable","with","continuous","parents",":","math",":","`","X1",",","X2",",","\\cdots",",","Xk","`",".","We","say","that",":","math",":","`","Y","`","has","a","linear","Gaussian","CPD","if","there","are","parameters",":","math",":","`","\\beta_0",",","\\beta_1",",","...",",","\\beta_k","`","and",":","math",":","`","\\sigma_2","`","such","that",",","..","math",":",":","p","(","Y","|x1",",","x2",",","...",",","xk",")","=","\\mathcal","{","N","}","(","\\beta_0","+","x1","*","\\beta_1","+",".........","+","xk","*","\\beta_k","\u037e","\\sigma_2",")","In","vector","notation",",","..","math",":",":","p","(","Y","|x",")","=","\\mathcal","{","N","}","(","\\beta_0","+","\\boldmath","{","\u03b2","}",".T","*","\\boldmath","{","x","}","\u037e","\\sigma_2",")","References","--","--","--","--","--","..","[","1","]","https",":","\/\/cedar.buffalo.edu\/~srihari\/CSE574\/Chap8\/Ch8-PGM-GaussianBNs\/8.5","%","20GaussianBNs.pdf"]
docstr: Parameters
  ----------
  
  variable: any hashable python object
      The variable whose CPD is defined.
  
  evidence_mean: Mean vector (numpy array) of the joint distribution, X
  
  evidence_variance: int, float
      The variance of the multivariate gaussian, X = ['x1', 'x2', ..., 'xn']
  
  evidence: iterable of any hashable python objects
      An iterable of the parents of the variable. None if there are no parents.
  
  beta (optional): iterable of int or float
      An iterable representing the coefficient vector of the linear equation.
      The first term represents the constant term in the linear equation.
  
  
  Examples
  --------
  
  # For P(Y| X1, X2, X3) = N(-2x1 + 3x2 + 7x3 + 0.2; 9.6)
  
  >>> cpd = LinearGaussianCPD('Y',  [0.2, -2, 3, 7], 9.6, ['X1', 'X2', 'X3'])
  >>> cpd.variable
  'Y'
  >>> cpd.evidence
  ['x1', 'x2', 'x3']
  >>> cpd.beta_vector
  [0.2, -2, 3, 7]
docstr_tok: ["Parameters","--","--","--","--","--","variable",":","any","hashable","python","object","The","variable","whose","CPD","is","defined",".","evidence_mean",":","Mean","vector","(","numpy","array",")","of","the","joint","distribution",",","X","evidence_variance",":","int",",","float","The","variance","of","the","multivariate","gaussian",",","X","=","[","'x1","'",",","'x2","'",",","...",",","'xn","'","]","evidence",":","iterable","of","any","hashable","python","objects","An","iterable","of","the","parents","of","the","variable",".","None","if","there","are","no","parents",".","beta","(","optional",")",":","iterable","of","int","or","float","An","iterable","representing","the","coefficient","vector","of","the","linear","equation",".","The","first","term","represents","the","constant","term","in","the","linear","equation",".","Examples","--","--","--","--","#","For","P","(","Y|","X1",",","X2",",","X3",")","=","N","(","-2x1","+","3x2","+","7x3","+","0.2",";","9.6",")",">",">",">","cpd","=","LinearGaussianCPD","(","'","Y","'",",","[","0.2",",","-2",",","3",",","7","]",",","9.6",",","[","'X1","'",",","'X2","'",",","'X3","'","]",")",">",">",">","cpd.variable","'","Y'",">",">",">","cpd.evidence","[","'x1","'",",","'x2","'",",","'x3","'","]",">",">",">","cpd.beta_vector","[","0.2",",","-2",",","3",",","7","]"]
code: def __init__(
      self,
      variable,
      evidence_mean,
      evidence_variance,
      evidence=[],
      beta=None,
  ):
      """
      Parameters
      ----------
  
      variable: any hashable python object
          The variable whose CPD is defined.
  
      evidence_mean: Mean vector (numpy array) of the joint distribution, X
  
      evidence_variance: int, float
          The variance of the multivariate gaussian, X = ['x1', 'x2', ..., 'xn']
  
      evidence: iterable of any hashable python objects
          An iterable of the parents of the variable. None if there are no parents.
  
      beta (optional): iterable of int or float
          An iterable representing the coefficient vector of the linear equation.
          The first term represents the constant term in the linear equation.
  
  
      Examples
      --------
  
      # For P(Y| X1, X2, X3) = N(-2x1 + 3x2 + 7x3 + 0.2; 9.6)
  
      >>> cpd = LinearGaussianCPD('Y',  [0.2, -2, 3, 7], 9.6, ['X1', 'X2', 'X3'])
      >>> cpd.variable
      'Y'
      >>> cpd.evidence
      ['x1', 'x2', 'x3']
      >>> cpd.beta_vector
      [0.2, -2, 3, 7]
  
      """
      self.variable = variable
      self.mean = evidence_mean
      self.variance = evidence_variance
      self.evidence = evidence
      self.sigma_yx = None
  
      self.variables = [variable] + evidence
      super(LinearGaussianCPD, self).__init__(
          self.variables,
          pdf="gaussian",
          mean=self.mean,
          covariance=self.variance,
      )
  
file_path: pgmpy/pgmpy/factors/continuous/LinearGaussianCPD.py
imports: import numpy
  import pandas
  from scipy.stats import multivariate_normal
  from pgmpy.factors.base import BaseFactor
label_desc: Use image node_id 1 to create a new LinearGaussianCPD object from inherited base classes: BaseFactor with example: obj = LinearGaussianCPD(variable, evidence_mean, evidence_variance, evidence, beta)