You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to calculate a group-level RDM that is a bit more robust then just averaging all subject-level RDMs. The motivation for this e.g. to use it such a matrix as a model RDM for another set of subjects that do not have the corresponding data.
rdm_list = []
for sub in subjects:
print(f'roi {region_name} sub {sub}')
# load the beta patterns for this subject and collapse the run dimension
betas = data[f'betas_sub-{sub}_{region_name}']
patterns = betas.reshape(-1, betas.shape[-1])
# create an rsatoolbox Dataset with the patterns
ds = Dataset(
measurements=patterns,
descriptors=dict(sub=sub, roi=region_name),
obs_descriptors=dict(
run=numpy.repeat(numpy.arange(N_RUNS), len(conditions)),
condition=numpy.tile(conditions, N_RUNS)
)
)
# for every run, calculate the precision matrix from the residuals
runwise_prec_matrix = []
resids = data[f'resids_sub-{sub}_{region_name}']
for r in range(N_RUNS):
runwise_prec_matrix.append(
prec_from_residuals(
resids[r, :, :],
dof=degrees_of_freedom,
method='shrinkage_diag'
)
)
# calculate crossnobis RDMs from the patterns and precision matrices
rdm_list.append(
calc_rdm(
dataset=ds,
noise=runwise_prec_matrix,
method='crossnobis',
descriptor='condition',
cv_descriptor='run',
)
)
del rdm_list[-1].descriptors['noise'] # saves memory
How could I create a single group-level RDM based on rdm_list? Is it possible to calculate such a thing via CV? I specifically want to calculate based on a list of RDMs and not based on a dataset.
Scrolling through the rsatoolbox reference, I didn't see anything that seem to fit.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to calculate a group-level RDM that is a bit more robust then just averaging all subject-level RDMs. The motivation for this e.g. to use it such a matrix as a model RDM for another set of subjects that do not have the corresponding data.
Let's assume I have a object called
rdm_listlike the one from the pre-made tutorial (https://rsatoolbox.readthedocs.io/en/stable/demo_fmri_patterns.html):How could I create a single group-level RDM based on
rdm_list? Is it possible to calculate such a thing via CV? I specifically want to calculate based on a list of RDMs and not based on a dataset.Scrolling through the
rsatoolboxreference, I didn't see anything that seem to fit.Beta Was this translation helpful? Give feedback.
All reactions