I am trying to use the vector_auto_regression function on my SEEG dataset. I have no trouble running the tutorial pipeline. However, when I use my own dataset, vector_auto_regression creates a matrix where every row has the same value at each column – meaning that each electrode has the same influence on all other electrodes. Additionally, instead of ranging from -1 to 1, the values are in the order of magnitude of +/- 10^3. Has anyone encountered this problem before? What might be the problem?
My data have a sampling rate of 1000Hz and the original recording lasts for 2 hours. I first bandpass filtered from 0.5 to 300Hz and then applied a notch filter at 60Hz and its harmonics. Then, I removed bad channels before applying a common average reference. Finally, I trimmed the clip into a 5 minute segment and epoched intervals of 0.5s, without overlap. Using the 600 epochs, I created a dynamic VAR model with the default parameters. Unfortunately, I cannot share my data so it will be difficult for you to reproduce this problem. How can I proceed with fixing this?
My data are stored as .edf format. I am reading them in using mne.io.read_raw_edf(file_path). The default unit for the data is set to uV. If a try using a different unit in the read_raw_edf function then I get an error: “Unit for channel G1 is present in the file as ‘uV’, cannot overwrite it with the units argument ‘V’.” I investigated the data values at different percentiles. The absolute minimum is -0.003 and the absolute maximum is 0.002. The 5th percentile is -0.0003 and the 95th percentile is 0.0003.
I think I have isolated the problem! In my current pipeline, I re-reference the data using a common average reference with raw_ieeg.set_eeg_reference(ref_channels=‘average’). If I leave out this line of code and do not re-reference my data, then I get out sensible values ranging from (-1,1) differing across columns for vector_auto_regression. You can replicate this problem with the tutorial by adding a line to set the eeg reference to average.