Regarding the Boolean 'pca' option to tf_mixed_norm.py, I'm having trouble figuring what this is doing. In either the T or F case, I get a message saying "Not doing PCA for MEG", but then in the T case another message "Reducing data rank to X" is output, and the number of sensors represented in the input evoked data is reduced to this number. Disregarding the first message, this option appears to control doing temporal PCA on the sensor data? This is very tempting since the sensors likely represent an oversampling in space, but doesn't this require (temporal) stationarity of the data?
Regarding the Boolean 'pca' option to tf_mixed_norm.py, I'm having
trouble figuring what this is doing. In either the T or F case, I get a
message saying "Not doing PCA for MEG", but then in the T case another
message "Reducing data rank to X" is output, and the number of sensors
represented in the input evoked data is reduced to this number. Disregarding
the first message, this option appears to control doing temporal PCA on the
sensor data?
pca does a spatial PCA. Doc says:
pca: bool
If True the rank of the data is reduced to true dimension.
but maybe we can it clearer.
so if the rank of the data is 80 the optimization is run on in dimension 80
not 204 for example if you use gradiometers. It's just to save computation
time and should not have any effect on the numerical results.
This is very tempting since the sensors likely represent an
oversampling in space, but doesn't this require (temporal) stationarity of
the data?
with L21 MxNE you can also run a temporal PCA to save time. This is
what the time_pca parameter does. But it does not work with TF-MxNE
as it would break the temporal structure of the data.
If I understand you correctly, the PCA is being used in a data reduction capacity across the sensors, or the spatial dimension. In which case the sensor values at each sample represent the variables (204 in your example), and the samples in time represent the observations. The outcome of this are the component scores (80) at each sample which become the new timecourses.
The motivation for tf-mxne is do avoid assuming temporal stationarity of the neural sources. By performing the PCA solution over time, i.e. assuming that all of the observations come from the same population, do we not make the same error? This seems very similar to the traditional method of estimating the parameters of an MVAR system over time?
If I understand you correctly, the PCA is being used in a data reduction capacity across the sensors, or the spatial dimension. In which case the sensor values at each sample represent the variables (204 in your example), and the samples in time represent the observations.
yes
The outcome of this are the component scores (80) at each sample which become the new timecourses.
yes. You can see this step as a signal space projection ie. projection
onto the dimensions
which contain the most signal in the evoked data.
The motivation for tf-mxne is do avoid assuming temporal stationarity of the neural sources. By performing the PCA solution over time, i.e. assuming that all of the observations come from the same population, do we not make the same error? This seems very similar to the traditional method of estimating the parameters of an MVAR system over time?
this spatial projection is applied to the data and the gain matrix. If
the data was full rank it would be a rotation and the solution of
TF-MxNE would be exactly the same and the L2 data fit term is
invariant by rotation.
I think I misunderstand your response because it seems like two different items arise here:
First, as your publications mention, the model requires that the noise terms be Gaussian white noise. The whitening process is based on the noise covariance matrix and is designed to decorrelate the noise between different sensor channels and then to standardize the variance of these noise distributions. The noise covariance matrix itself is derived from either empty room measurements or combined periods of pre-stimulus measurement with the subject. In either case, these are resting states where we can assume the state of the system is stable and therefore can estimate these covariances over time.
Second is my question about the pca flag to tf_mixed_norm: is this doing a spatial pca on the post-stimulus data itself, or is this transformation also estimated from the pre-stimulus data? In the former case, I am concerned about stationarity (because the brain network is in a transient, dynamic state), but in the later it makes sense.
First, as your publications mention, the model requires that the noise terms be Gaussian white noise. The whitening process is based on the noise covariance matrix and is designed to decorrelate the noise between different sensor channels and then to standardize the variance of these noise distributions. The noise covariance matrix itself is derived from either empty room measurements or combined periods of pre-stimulus measurement with the subject. In either case, these are resting states where we can assume the state of the system is stable and therefore can estimate these covariances over time.
yes exactly.
Second is my question about the pca flag to tf_mixed_norm: is this doing a spatial pca on the post-stimulus data itself, or is this transformation also estimated from the pre-stimulus data? In the former case, I am concerned about stationarity (because the brain network is in a transient, dynamic state), but in the later it makes sense.
please have a look at this code:
the TF-MxNE line that uses pca param:
the function to whiten the data that is the same as the one used in
MNE/dSPM/sLORETA
the computation change between pca = True or False.
basically it just projects out of the space associated with the tiny
eigen values of the noise cov.
so there is no time involved and stationarity issues. Unless you
consider the noise cov to
vary with time but then you have a different model.