pymcdm.correlations

pymcdm.correlations.goodman_kruskal_gamma(x, y)

Calculate Goodman’s and Kruskal’s Gamma correlation between two ranking vectors [1].

Parameters:
  • x (ndarray) – First vector of ranks.

  • y (ndarray) – Second vector of ranks.

Returns:

Correlation between two rankings vectors.

Return type:

float

Notes

If there are no comparable pairs (i.e., the denominator is zero), Gamma is undefined. In such cases, a UserWarning is emitted.

References

pymcdm.correlations.kendall_tau(x, y)

Calculate Kendall Tau correlation between two rankings vectors [2].

Parameters:
  • x (ndarray) – First vector of ranks.

  • y (ndarray) – Second vector of ranks.

Returns:

Correlation between two rankings vectors.

Return type:

float

References

pymcdm.correlations.pearson(x, y)

Calculate Pearson correlation between two raw vectors [3].

Parameters:
  • x (ndarray) – First vector with raw values.

  • y (ndarray) – Second vector with raw values.

Returns:

Correlation between two vectors.

Return type:

float

Notes

If either input vector has zero variance, the Pearson correlation is undefined. In such cases, a UserWarning is emitted. This function can also be used via its alias: r().

References

pymcdm.correlations.r(x, y)

Alias to pymcdm.correlations.pearson() function.

pymcdm.correlations.rank_similarity_coef(x, y)

Calculate Rank Similarity Coefficient (WS) between two ranking vectors [4].

Parameters:
  • x (ndarray) – First vector of ranks.

  • y (ndarray) – Second vector of ranks.

Returns:

Correlation between two rankings vectors.

Return type:

float

Notes

This function can also be used via its alias: ws().

References

pymcdm.correlations.rs(x, y)

Alias to pymcdm.correlations.spearman() function.

pymcdm.correlations.rw(x, y)

Alias to pymcdm.correlations.weighted_spearman() function.

pymcdm.correlations.spearman(x, y)

Calculate Spearman correlation between two rankings vectors [5].

Parameters:
  • x (ndarray) – First vector of ranks.

  • y (ndarray) – Second vector of ranks.

Returns:

Correlation between two rankings vectors.

Return type:

float

Notes

If either input vector has zero variance, the Spearman correlation is undefined. In such cases, a UserWarning is emitted. This function can also be used via its alias: rs().

References

pymcdm.correlations.weighted_spearman(x, y)

Calculate Weighted Spearman correlation between two rankings vectors [6].

Parameters:
  • x (ndarray) – First vector of ranks.

  • y (ndarray) – Second vector of ranks.

Returns:

Correlation between two rankings vectors.

Return type:

float

Notes

This function can also be used via its alias: rw().

References

pymcdm.correlations.ws(x, y)

Alias to pymcdm.correlations.rank_similarity_coef() function.

pymcdm.correlations.wsc(w0, w1)

Weights similarity coefficient for measuring the similarity between the criteria weights [7].

Parameters:
  • w0 (ndarray) – First vector of weights.

  • w1 (ndarray) – Second vector of weights.

Returns:

The similarity of the weights in range [0, 1], where 0 is different weights, and 1 is the same weights.

Return type:

float

References

pymcdm.correlations.wsc2(w0, w1)

Weights similarity coefficient for measuring the similarity between the criteria weights. This is symmetrical version, i.e. wsc2(a, b) == wsc2(b, a) [8].

Parameters:
  • w0 (ndarray) – First vector of weights.

  • w1 (ndarray) – Second vector of weights.

Returns:

The similarity of the weights in range [0, 1], where 0 is different weights, and 1 is the same weights.

Return type:

float

References