-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store n_cycles
and time_bandwidth
params in *TFR
objects
#12851
Comments
Since we already store weights for spectrum objects, I'm inclined to store weights (not estimation params) for TFRs too. That saves having to recompute them when users pass MNE objects (not arrays) to the connectivity functions, and is more internally consistent. (this assumes that we don't anticipate needing When users pass NumPy arrays to the conn functions, they can/should expect that they'll need to provide some extra information, so IMO it's fine to ask them to pass in estimation params (n_cycles and mt_bandwidth) and we calc the weights for them at that time... even though it's a bit error-prone to trust that the user passes the same values to both the TFR function and the connectivity function. Another option would be adding |
Sure, I see your reasoning, especially to keep it consistent with
Just to clarify, for the proposed connectivity function changes, users would still only be able to pass in arrays of epoched timeseries data, not epoched coefficients. If we change to store weights in |
Ah OK, so it's for any non-spectral/spectrotemporal data (whether in Epochs object form or array form) where they need to pass the estimation params. That makes sense. |
Yeah, exactly. |
Had a look into this and have a question about the implementation: When However,
Is a public API change like this acceptable? If not, then the weights would need to be recomputed in the |
I find this acceptable. The
|
Sorry for not opening a PR on this yet, things ended up being a little more complicated. Making the changes so that Fixing However, since this is a distinct thing to adding a |
Describe the new feature or enhancement
Discussed partly with @larsoner.
MNE-Connectivity is being updated to allow connectivity computations using complex coefficients stored in
EpochsTFR
objects (mne-tools/mne-connectivity#232). For the multitaper method, TFR coefficients have a tapers dimension that need to be aggregated over when computing the CSD. These weights are not stored in the*TFR
objects, and computing these weights requires knowledge of thetime_bandwidth
andn_cycles
used to estimate the TFR. However, currently these parameters are not stored in*TFR
objects.If we want to accurately compute these weights in MNE-Connectivity, we would currently require the user to pass these parameters in addition to the
EpochsTFR
object. It would be more convenient if this information could also be read from theEpochsTFR
object.Describe your proposed implementation
There were two ideas:
tfr.n_cycles
andtfr.time_bandwidth
*TFR
namespace, e.g.,tfr.estimation_parameters = {'mt_bandwidth': 4, 'n_cycles': 5}
Describe possible alternatives
An alternative would be to just store the taper weights in the
*TFR
objects, which is similar to how this is now handled for*Spectrum
objects. However, the weights are not returned bytfr_array_multitaper
, so they would still need to be recomputed.It's perhaps simpler if we just handle this in MNE-Connectivity using the stored estimation params.
What do people think is the best choice?
The text was updated successfully, but these errors were encountered: