esmtools.stats.corr

esmtools.stats.corr(x, y, dim='time', lead=0, return_p=False)[source]

Computes the Pearson product-moment coefficient of linear correlation.

Parameters:
  • y (x,) – Time series being correlated.
  • dim (str, optional) – Dimension to calculate correlation over. Defaults to ‘time’.
  • lead (int, optional) – If lead > 0, x leads y by that many time steps. If lead < 0, x lags y by that many time steps. Defaults to 0.
  • return_p (bool, optional) – and p value. Otherwise, just returns the correlation coefficient.
Returns:

Pearson correlation coefficient. pval (xarray object): p value, if return_p is True.

Return type:

corrcoef (xarray object)