chaospy.Var¶
- chaospy.Var(poly, dist=None, **kws)[source]¶
The variance of a distribution or polynomial.
- Args:
- poly (numpoly.ndpoly, Distribution):
Input to take variance on.
- dist (Distribution):
Defines the space the variance is taken on. It is ignored if
poly
is a distribution.
- Returns:
- (numpy.ndarray):
Element for element variance along
poly
, wherevariation.shape == poly.shape
.
- Examples:
>>> dist = chaospy.J(chaospy.Gamma(1, 1), chaospy.Normal(0, 2)) >>> chaospy.Var(dist) array([1., 4.]) >>> q0, q1 = chaospy.variable(2) >>> poly = chaospy.polynomial([1, q0, q1, 10*q0*q1]) >>> chaospy.Var(poly, dist) array([ 0., 1., 4., 800.]) >>> chaospy.Var(2., dist) array(0.)