rsatoolbox.inference.bootstrap module

inference module: bootstrapping

rsatoolbox.inference.bootstrap.bootstrap_sample(rdms, rdm_descriptor='index', pattern_descriptor='index')[source]

Draws a bootstrap_sample from the data.

This function generates a bootstrap sample of RDMs resampled over measurements and patterns. By default every pattern and RDM sample is treated independently. If desired descriptor names can be passed in descriptors and in pattern_descriptors to group rdms instead.

Parameters:
  • rdms (rsatoolbox.rdm.rdms.RDMs) – Data to be used

  • rdm_descriptors (String) – descriptor to group the samples by. For each unique value of the descriptor each sample will either contain all RDMs with this value or none

  • pattern_descriptors (string) – descriptor to group the patterns by. Each group of patterns will be in or out of the sample as a whole

Returns:

rdms

subsampled dataset with equal number of groups in both patterns and measurements of the rdms

numpy.ndarray: rdm_idx

sampled rdm indices

numpy.ndarray: pattern_idx

sampled pattern descriptor indices

Return type:

rsatoolbox.rdm.rdms.RDMs

rsatoolbox.inference.bootstrap.bootstrap_sample_pattern(rdms, pattern_descriptor='index')[source]

Draws a bootstrap_sample from the data.

This function generates a bootstrap sample of RDMs resampled over patterns. By default every pattern is treated independently. If desired a descriptor name can be passed in pattern_descriptor to group patterns.

Parameters:
  • rdms (rsatoolbox.rdm.rdms.RDMs) – Data to be used

  • pattern_descriptors (string) – descriptor to group the patterns by. Each group of patterns will be in or out of the sample as a whole

Returns:

rdm_idx

subsampled dataset with equal number of pattern groups

numpy.ndarray: pattern_idx

sampled pattern descriptor index values for subsampling other rdms

Return type:

rsatoolbox.rdm.rdms.RDMs

rsatoolbox.inference.bootstrap.bootstrap_sample_rdm(rdms, rdm_descriptor='index')[source]

Draws a bootstrap_sample from the data.

This function generates a bootstrap sample of RDMs resampled over measurements. By default every RDM sample is treated independently. If desired a descriptor name can be passed inrdm_descriptor to group rdms.

Parameters:
  • rdms (rsatoolbox.rdm.rdms.RDMs) – Data to be used

  • rdm_descriptors (String) – descriptor to group the samples by. For each unique value of the descriptor each sample will either contain all RDMs with this value or none

Returns:

rdm_idx

subsampled dataset with equal number of groups of rdms

numpy.ndarray: rdm_idx

sampled rdm indices

numpy.ndarray: rdm_select

rdm group descritor values

Return type:

rsatoolbox.rdm.rdms.RDMs