chaospy.Corr¶
- chaospy.Corr(poly, dist=None, **kws)[source]¶
Correlation matrix of a distribution or polynomial.
- Args:
- poly (numpoly.ndpoly, Distribution):
Input to take correlation on. Must have
len(poly)>=2
.- dist (Distribution):
Defines the space the correlation is taken on. It is ignored if
poly
is a distribution.
- Returns:
- (numpy.ndarray):
Correlation matrix with
correlation.shape == poly.shape+poly.shape
.
- Examples:
>>> distribution = chaospy.MvNormal( ... [3, 4], [[2, .5], [.5, 1]]) >>> chaospy.Corr(distribution).round(4) array([[1. , 0.3536], [0.3536, 1. ]]) >>> q0 = chaospy.variable() >>> poly = chaospy.polynomial([q0, q0**2]) >>> distribution = chaospy.Normal() >>> chaospy.Corr(poly, distribution).round(4) array([[1., 0.], [0., 1.]])