chaospy.E_cond

chaospy.E_cond(poly, freeze, dist, **kws)[source]

Conditional expected value of a distribution or polynomial.

1st order statistics of a polynomial on a given probability space conditioned on some of the variables.

Args:
poly (numpoly.ndpoly):

Polynomial to find conditional expected value on.

freeze (numpy.ndpoly):

Boolean values defining the conditional variables. True values implies that the value is conditioned on, e.g. frozen during the expected value calculation.

dist (Distribution) :

The distributions of the input used in poly.

Returns:
(numpoly.ndpoly) :

Same as poly, but with the variables not tagged in frozen integrated away.

Examples:
>>> q0, q1 = chaospy.variable(2)
>>> poly = chaospy.polynomial([1, q0, q1, 10*q0*q1-1])
>>> poly
polynomial([1, q0, q1, 10*q0*q1-1])
>>> dist = chaospy.J(chaospy.Gamma(1, 1), chaospy.Normal(0, 2))
>>> chaospy.E_cond(poly, q0, dist)
polynomial([1.0, q0, 0.0, -1.0])
>>> chaospy.E_cond(poly, q1, dist)
polynomial([1.0, 1.0, q1, 10.0*q1-1.0])
>>> chaospy.E_cond(poly, [q0, q1], dist)
polynomial([1, q0, q1, 10*q0*q1-1])
>>> chaospy.E_cond(poly, [], dist)
polynomial([1.0, 1.0, 0.0, -1.0])
>>> chaospy.E_cond(4, [], dist)
array(4)