objective_weighting.correlations

Module Contents

Functions

spearman(R, Q)

Calculate Spearman rank correlation coefficient between two vectors

weighted_spearman(R, Q)

Calculate Weighted Spearman rank correlation coefficient between two vectors

pearson_coeff(R, Q)

Calculate Pearson correlation coefficient between two vectors

objective_weighting.correlations.spearman(R, Q)[source]

Calculate Spearman rank correlation coefficient between two vectors

Parameters
  • R (ndarray) – First vector containing values

  • Q (ndarray) – Second vector containing values

Returns

Value of correlation coefficient between two vectors

Return type

float

Examples

>>> rS = spearman(R, Q)
objective_weighting.correlations.weighted_spearman(R, Q)[source]

Calculate Weighted Spearman rank correlation coefficient between two vectors

Parameters
  • R (ndarray) – First vector containing values

  • Q (ndarray) – Second vector containing values

Returns

Value of correlation coefficient between two vectors

Return type

float

Examples

>>> rW = weighted_spearman(R, Q)
objective_weighting.correlations.pearson_coeff(R, Q)[source]

Calculate Pearson correlation coefficient between two vectors

Parameters
  • R (ndarray) – First vector containing values

  • Q (ndarray) – Second vector containing values

Returns

Value of correlation coefficient between two vectors

Return type

float

Examples

>>> corr = pearson_coeff(R, Q)