metobs_toolkit.analysis.Analysis.get_lc_correlation_matrices#

Analysis.get_lc_correlation_matrices(obstype=['temp'], groupby_labels=['hour'])[source]#

Compute pearson correlation coeficients.

A method to compute the Pearson correlation between an obervation type and present landcover fractions in the metadf.

The correlations are computed per group as defined by unique combinations of the groupby_labels.

A dictionary is returnd where each key represents a unique combination of the groupby_labels. The value is a dictionary with the following keys and values:

  • cor matrix: the Pearson correlation matrix

  • significance matrix: the significance (p-)values of the correlations.

  • combined matrix: A human readable combination of the correlations and their p values. Indicate by *, ** or *** representing p-values < 0.05, 0.01 and 0.001 respectively.

This dictionary is also stored as a lc_cor_dict attribute.

Parameters:
  • obstype (str, or list optional) – The observation type(s) to compute the correlations on. The default is [‘temp’].

  • groupby_labels (list, optional) – List of variables to form one group, resulting in one correlation. These variables should either a categorical observation type, a categorical column in the metadf or a time aggregation. All possible time aggreagetions are: [‘minute’, ‘hour’, ‘month’, ‘year’, ‘day_of_year’, ‘week_of_year’, ‘season’]. The default is [‘hour’].

Returns:

cor_dict – A nested dictionary with unique combinations of groupby values.

Return type:

dict