Hello everyone,
I’m looking to do source localization on MEG data with a DICS beamformer. I’m computing a noise and data cross-spectral density matrix using csd_morlet(). When I use these as input to create the spatial filters with make_dics(), I get a runtime warning saying that “data covariance does not appear to be positive semidefinite, results will likely be incorrect”. I don’t get this warning at all when I use csd_multitaper() or csd_fourier() and only for a handful of participants. Has anyone encountered this warning before? How could I go about debugging?
I’ve tried a bunch of different settings, but this is my most recent code:
noise_csd = mne.time_frequency.csd_morlet(epochs = epochs,
frequencies = np.arange(13, 31, 1),
tmin = -0.2 + delay,
tmax = 0 + delay,
picks = None,
n_cycles = 2,
use_fft = True,
decim = 1,
projs = None,
n_jobs = 8)
noise_csd = noise_csd.mean()
data_csd = mne.time_frequency.csd_morlet(epochs = epochs,
frequencies = frequencies,
tmin = 0 + delay,
tmax = 1 + delay,
picks = None,
n_cycles = 2,
use_fft = True,
decim = 1,
projs = None,
n_jobs = -1)
data_csd = data_csd.mean()
filters = mne.beamformer.make_dics(info = epochs.info,
forward = fwd,
csd = data_csd,
reg = 0.05,
noise_csd = noise_csd,
pick_ori = 'max-power',
rank = 'info',
weight_norm = 'unit-noise-gain',
reduce_rank = True,
depth = None,
real_filter = True,
inversion = 'matrix',
verbose = None)
MNE version: 1.3.0
MNE connectivity: 0.6.0
operating system: macOS Monterey 12.5.1
Best,
Chantal