def expect(self, fn=None, args=(), loc=0, scale=1, lb=None, ub=None, conditional=False):
 if (fn is None):
  def fun(x, *args):
   return (x * self.pdf(x, loc=loc, scale=scale, *args))
 else:
  def fun(x, *args):
   return (fn(x) * self.pdf(x, loc=loc, scale=scale, *args))
 if (lb is None):
  lb = (loc + (self.a * scale))
 if (ub is None):
  ub = (loc + (self.b * scale))
 if conditional:
  invfac = (self.sf(lb, loc=loc, scale=scale, *args) - self.sf(ub, loc=loc, scale=scale, *args))
 else:
  invfac = 1.0
 return (integrate.quad(fun, lb, ub, args=args)[0] / invfac)

def expect ( self , fn = None , args = ( ) , loc = 0 , scale = 1 , lb = None , ub = None , conditional = False ) : if ( fn is None ) : def fun ( x , * args ) : return ( x * self . pdf ( x , loc = loc , scale = scale , * args ) ) else : def fun ( x , * args ) : return ( fn ( x ) * self . pdf ( x , loc = loc , scale = scale , * args ) ) if ( lb is None ) : lb = ( loc + ( self . a * scale ) ) if ( ub is None ) : ub = ( loc + ( self . b * scale ) ) if conditional : invfac = ( self . sf ( lb , loc = loc , scale = scale , * args ) - self . sf ( ub , loc = loc , scale = scale , * args ) ) else : invfac = 1.0 return ( integrate . quad ( fun , lb , ub , args = args ) [ 0 ] / invfac )
evaluates and tests all given expressions .