class_docstr: Symbolic class Central Moment
  
  Examples
  ========
  
  >>> from sympy import Symbol, Integral
  >>> from sympy.stats import Normal, Expectation, Probability, CentralMoment
  >>> mu = Symbol('mu', real=True)
  >>> sigma = Symbol('sigma', positive=True)
  >>> X = Normal('X', mu, sigma)
  >>> CM = CentralMoment(X, 4)
  
  To evaluate the result of CentralMoment use `doit`:
  
  >>> CM.doit().simplify()
  3*sigma**4
  
  Rewrite the CentralMoment expression in terms of Expectation:
  
  >>> CM.rewrite(Expectation)
  Expectation((-Expectation(X) + X)**4)
  
  Rewrite the CentralMoment expression in terms of Probability:
  
  >>> CM.rewrite(Probability)
  Integral((x - Integral(x*Probability(True), (x, -oo, oo)))**4*Probability(Eq(X, x)), (x, -oo, oo))
  
  Rewrite the CentralMoment expression in terms of Integral:
  
  >>> CM.rewrite(Integral)
  Integral(sqrt(2)*(X - Integral(sqrt(2)*X*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo)))**4*exp(-(X - mu)**2/(2*sigma**2))/(2*sqrt(pi)*sigma), (X, -oo, oo))
class_docstr_tok: ["Symbolic","class","Central","Moment","Examples","========",">",">",">","from","sympy","import","Symbol",",","Integral",">",">",">","from","sympy.stats","import","Normal",",","Expectation",",","Probability",",","CentralMoment",">",">",">","mu","=","Symbol","(","'mu","'",",","real=True",")",">",">",">","sigma","=","Symbol","(","'sigma","'",",","positive=True",")",">",">",">","X","=","Normal","(","'","X","'",",","mu",",","sigma",")",">",">",">","CM","=","CentralMoment","(","X",",","4",")","To","evaluate","the","result","of","CentralMoment","use","`","doit","`",":",">",">",">","CM.doit","(",")",".simplify","(",")","3","*","sigma","*","*","4","Rewrite","the","CentralMoment","expression","in","terms","of","Expectation",":",">",">",">","CM.rewrite","(","Expectation",")","Expectation","(","(","-Expectation","(","X",")","+","X",")","*","*","4",")","Rewrite","the","CentralMoment","expression","in","terms","of","Probability",":",">",">",">","CM.rewrite","(","Probability",")","Integral","(","(","x","-","Integral","(","x","*","Probability","(","True",")",",","(","x",",","-oo",",","oo",")",")",")","*","*","4","*","Probability","(","Eq","(","X",",","x",")",")",",","(","x",",","-oo",",","oo",")",")","Rewrite","the","CentralMoment","expression","in","terms","of","Integral",":",">",">",">","CM.rewrite","(","Integral",")","Integral","(","sqrt","(","2",")","*","(","X","-","Integral","(","sqrt","(","2",")","*","X","*","exp","(","-","(","X","-","mu",")","*","*","2\/","(","2","*","sigma","*","*","2",")",")","\/","(","2","*","sqrt","(","pi",")","*","sigma",")",",","(","X",",","-oo",",","oo",")",")",")","*","*","4","*","exp","(","-","(","X","-","mu",")","*","*","2\/","(","2","*","sigma","*","*","2",")",")","\/","(","2","*","sqrt","(","pi",")","*","sigma",")",",","(","X",",","-oo",",","oo",")",")"]
code: def _eval_rewrite_as_Expectation(
      self, X, n, condition=None, **kwargs
  ):
      mu = Expectation(X, condition, **kwargs)
      return Moment(X, n, mu, condition, **kwargs).rewrite(Expectation)
  
imports: import itertools
  from sympy.concrete.summations import Sum
  from sympy.core.add import Add
  from sympy.core.expr import Expr
  from sympy.core.function import expand
  from sympy.core.mul import Mul
  from sympy.core.relational import Eq
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.integrals.integrals import Integral
  from sympy.logic.boolalg import Not
  from sympy.core.parameters import global_parameters
  from sympy.core.sorting import default_sort_key
  from sympy.core.sympify import _sympify
  from sympy.core.relational import Relational
  from sympy.logic.boolalg import Boolean
  from sympy.stats import variance, covariance
  from sympy.stats.rv import RandomSymbol, pspace, dependent, given, sampling_E, RandomIndexedSymbol, is_random, PSpace, sampling_P, random_symbols
label_desc: Use image node_id 3 for calling the CentralMoment obj's underlying member method code with example usage: obj._eval_rewrite_as_Expectation(X, n, condition) and returns: Moment