def test_conjunction_analysis(self): """Test the conjunction analysis.""" y, gt = sim_mi_cc(x, snr=1.) dt = DatasetEphy(x, y, roi, times=time) wf = WfMi(mi_type='cc', inference='rfx') mi, pv = wf.fit(dt, **kw_mi) cj_ss, cj = wf.conjunction_analysis(dt) assert cj_ss.shape == (n_subjects, n_times, n_roi) assert cj.shape == (n_times, n_roi)
############################################################################### # Perform the conjunction analysis # -------------------------------- # # Now we have the values of MI we can compute the conjunction analysis. The # following method returns two DataArray : # # - conj_ss : DataArray of shape (n_subjects, n_times, n_roi) that contains the # significant MI of each subject # - conj : DataArray of shape (n_times, n_roi) that contains the number of # subjects that have a significant effect at each time point and for # each roi # perform the conjunction analysis conj_ss, conj = wf.conjunction_analysis() ############################################################################### # Plot where there's significant effect for each subject # ------------------------------------------------------ # # printing the results print(conj_ss) fig = plt.figure(figsize=(10, 8)) q = 0 for n_s in range(n_subjects): color = ephy[f'subject_{n_s}']['color'] for n_r, roi in enumerate(conj.roi.data): q += 1