brainpy.measure.weighted_correlation#

brainpy.measure.weighted_correlation(x, y, w, numpy=True)[source]#

Weighted Pearson correlation of two data series.

Parameters
  • x (ndarray) – The data series 1.

  • y (ndarray) – The data series 2.

  • w (ndarray) – Weight vector, must have same length as x and y.

  • numpy (bool) – Whether we use numpy array as the functional output. If False, this function can be JIT compiled.

Returns

corr – Weighted correlation coefficient.

Return type

ndarray