class_docstr: This class uses the rounding method for discretizing the
  given continuous distribution.
  
  For the rounding method,
  
  The probability mass is,
  cdf(x+step/2)-cdf(x), for x = low
  
  cdf(x+step/2)-cdf(x-step/2), for low < x <= high
  
  where, cdf is the cumulative density function of the distribution
  and step = (high-low)/cardinality.
  
  Examples
  --------
  >>> import numpy as np
  >>> from pgmpy.factors.continuous import ContinuousNode
  >>> from pgmpy.factors.continuous import RoundingDiscretizer
  >>> std_normal_pdf = lambda x : np.exp(-x*x/2) / (np.sqrt(2*np.pi))
  >>> std_normal = ContinuousNode(std_normal_pdf)
  >>> std_normal.discretize(RoundingDiscretizer, low=-3, high=3,
  ...                       cardinality=12)
  [0.001629865203424451, 0.009244709419989363, 0.027834684208773178,
   0.065590616803038182, 0.120977578710013, 0.17466632194020804,
   0.19741265136584729, 0.17466632194020937, 0.12097757871001302,
   0.065590616803036905, 0.027834684208772664, 0.0092447094199902269]
class_docstr_tok: ["This","class","uses","the","rounding","method","for","discretizing","the","given","continuous","distribution",".","For","the","rounding","method",",","The","probability","mass","is",",","cdf","(","x+step\/2",")","-cdf","(","x",")",",","for","x","=","low","cdf","(","x+step\/2",")","-cdf","(","x-step\/2",")",",","for","low","<","x","<","=","high","where",",","cdf","is","the","cumulative","density","function","of","the","distribution","and","step","=","(","high-low",")","\/cardinality",".","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","from","pgmpy.factors.continuous","import","ContinuousNode",">",">",">","from","pgmpy.factors.continuous","import","RoundingDiscretizer",">",">",">","std_normal_pdf","=","lambda","x",":","np.exp","(","-x","*","x\/2",")","\/","(","np.sqrt","(","2","*","np.pi",")",")",">",">",">","std_normal","=","ContinuousNode","(","std_normal_pdf",")",">",">",">","std_normal.discretize","(","RoundingDiscretizer",",","low=-3",",","high=3",",","...","cardinality=12",")","[","0.001629865203424451",",","0.009244709419989363",",","0.027834684208773178",",","0.065590616803038182",",","0.120977578710013",",","0.17466632194020804",",","0.19741265136584729",",","0.17466632194020937",",","0.12097757871001302",",","0.065590616803036905",",","0.027834684208772664",",","0.0092447094199902269","]"]
code: def get_discrete_values(self):
      step = (self.high - self.low) / self.cardinality
  
      # for x=[low]
      discrete_values = [
          self.factor.cdf(self.low + step / 2)
          - self.factor.cdf(self.low)
      ]
  
      # for x=[low+step, low+2*step, ........., high-step]
      points = np.linspace(
          self.low + step, self.high - step, self.cardinality - 1
      )
      discrete_values.extend(
          [
              self.factor.cdf(i + step / 2)
              - self.factor.cdf(i - step / 2)
              for i in points
          ]
      )
  
      return discrete_values
  
file_path: pgmpy/pgmpy/factors/continuous/discretize.py
imports: from abc import ABCMeta, abstractmethod
  import numpy
  from scipy import integrate
label_desc: Use image node_id 1 for calling the RoundingDiscretizer obj's underlying member method code with example usage: obj.get_discrete_values() and returns: discrete_values