(self, expr, var, evaluate=True, **kwargs)
return integral.doit() if evaluate else integral
Expectation of expression over distribution
Expectation of expression over distribution
Expectation of expression over distribution
def expectation(self, expr, var, evaluate=True, **kwargs):
        """ Expectation of expression over distribution """
        integral = Integral(expr * self.pdf(var), (var, self.set), **kwargs)
        return integral.doit() if evaluate else integral
def expectation ( self , expr , var , evaluate = True , * * kwargs ) : integral = Integral ( expr * self . pdf ( var ) , ( var , self . set ) , * * kwargs ) return integral . doit ( ) if evaluate else integral