chaospy.Spearman

chaospy.Spearman(poly, dist=None, sample=10000, retall=False, **kws)[source]

Calculate Spearman’s rank-order correlation coefficient.

Args:
poly (numpoly.ndpoly):

Polynomial of interest.

dist (Distribution):

Defines the space where correlation is taken.

sample (int):

Number of samples used in estimation.

retall (bool):

If true, return p-value as well.

Returns:
(float, numpy.ndarray):

Correlation output rho. Of type float if two-dimensional problem. Correleation matrix if larger.

(float, numpy.ndarray):

The two-sided p-value for a hypothesis test whose null hypothesis is that two sets of data are uncorrelated, has same dimension as rho.

Examples:
>>> distribution = chaospy.MvNormal(
...     [3, 4], [[2, .5], [.5, 1]])
>>> corr, pvalue = chaospy.Spearman(distribution, sample=50, retall=True)
>>> corr.round(4)
array([[1.   , 0.603],
       [0.603, 1.   ]])
>>> pvalue.round(8)
array([[0.00e+00, 3.58e-06],
       [3.58e-06, 0.00e+00]])