mne_rsa.rsa_gen#

mne_rsa.rsa_gen(rdm_data_gen, rdm_model, metric='spearman', ignore_nan=False)[source]#

Generate RSA values between data and model RDMs.

Will yield RSA scores for each data RDM.

Parameters
rdm_data_gengenerator of ndarray, shape (n_items, n_items)

The generator for data RDMs

rdm_modelndarray, shape (n_items, n_items) | list of ndarray

The model RDM, or list of model RDMs.

metricstr

The RSA metric to use to compare the RDMs. Valid options are:

  • ‘spearman’ for Spearman’s correlation (the default)

  • ‘pearson’ for Pearson’s correlation

  • ‘kendall-tau-a’ for Kendall’s Tau (alpha variant)

  • ‘partial’ for partial Pearson correlations

  • ‘partial-spearman’ for partial Spearman correlations

  • ‘regression’ for linear regression weights

Defaults to ‘spearman’.

ignore_nanbool

Whether to treat NaN’s as missing values and ignore them when computing the distance metric. Defaults to False.

New in version 0.8.

Yields
rsa_valfloat | ndarray, shape (len(rdm_model),)

For each data RDM, the representational similarity with the model RDM. When multiple model RDMs are specified, this will be a 1D array of similarities, comparing the data RDM with each model RDM.

See also

rsa