Skip to content
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

Continuous SSP projection #102

Closed
larsoner opened this issue Sep 19, 2012 · 7 comments
Closed

Continuous SSP projection #102

larsoner opened this issue Sep 19, 2012 · 7 comments

Comments

@larsoner
Copy link
Member

Currently there are options for making SSP projectors for epochs and from averages, but none for doing a continuous SSP projection vector for an entire (raw) run like there is in mne_process_raw. I have tried "faking it" by pulling in the entire run as an epoch, but I run into an error doing this. I am probably doing something wrong, but at least having a wrapper that accomplished this correctly would be very useful.

@agramfort
Copy link
Member

we could add this but maybe a better way is indeed to make epochs from raw with fixed length such as 1s. I would allow you do reject bad segments for the SSP computation.

wdyt?

@larsoner
Copy link
Member Author

I think both ways will make sense for different uses. In my code, I actually don't want epoch rejection because there is some large, low-frequency drift (that goes away with a couple continuous projectors) that would disqualify all epochs. I currently have code for doing it by chunking epochs with a chosen fixed length, but I was hoping to get something that was actually equivalent to what is done in mne_process_raw (to stay as close as possible).

@larsoner
Copy link
Member Author

I noticed that the way the projectors are computed in compute_proj_evoked in proj.py is by taking the sum across epochs of the matrix multiplications (channelsxtime into timexchannels). I am curious why this is done instead of using the matrix multiplication of the temporally-concatenated (across epochs) matrices (chanellsxconcatenated_time into concatenated_timexchannels)? I understand the former is probably more efficient, but is one preferable to another from a mathematical standpoint? I ask because I noticed that I got different results when "faking" continuous projection calculation by using consecutive 1, 10, or 100 second windows to create epochs from my raw data.

@larsoner
Copy link
Member Author

I submitted some continuous SSP code to code review so we can discuss it there.

@agramfort
Copy link
Member

I currently have code for doing it by chunking epochs with a chosen fixed length

a function like:

mne.make_fix_length_events(raw, duration=4)

would be convenient to have.

I noticed that the way the projectors are computed in compute_proj_evoked
in proj.py is by taking the sum across epochs of the matrix multiplications
(channelsxtime into timexchannels). I am curious why this is done instead of
using the matrix multiplication of the temporally-concatenated (across
epochs) matrices (chanellsxconcatenated_time into
concatenated_timexchannels)?

memory allocation. You don't need to read everything in memory by doing so.

I understand the former is probably more
efficient, but is one preferable to another from a mathematical standpoint?

no just efficiency

I ask because I noticed that I got different results when "faking"
continuous projection calculation by using consecutive 1, 10, or 100 second
windows to create epochs from my raw data.

hum. can you submit a test script?

@larsoner
Copy link
Member Author

I'll add the make_fix_length_events(raw, duration=4) [but I'll probably make the default 1 second] function to my modified codebase, where we can continue the discussion. Closing this one.

@agramfort
Copy link
Member

perfect !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants