# [FieldTrip] SVD and projectmom

Eelke Spaak e.spaak at donders.ru.nl
Wed Oct 14 14:58:55 CEST 2020

```Hi John,

I'm not sure the following is a full answer to your questions, but
it's definitely relevant to both of them. As you say, there are by
default 3 dipole orientations along which activity is considered. We
can combine these three into one (using SVD or similar) at (at least)
three possible levels:

(a) the level of the leadfield;
(b) the level of the filters;
(c) the level of the source-reconstructed data.

What you are suggesting in question 2 is approach b. Your phrasing
a, but unless I'm misunderstanding you really are proposing approach
b.

What by default is implemented in FieldTrip (cfg.projectmom = 'yes')
is approach c. This I think answers your question 1: the data
covariance is projected through the filters in order to determine the
maximum orientation of the source-reconstructed data.

Also of relevance: you can use the non-downprojected (3xN) filters, as
computed based on some data X, and apply them to some data Y, and only
downproject after that. This might result in a different orientation
being the "maximal" one, as the maximum (in approach c) depends not
only on the filters (and hence the leadfield), but also on the data.

Hope that helps.

Best,
Eelke

On Tue, 13 Oct 2020 at 21:06, RICHARDS, JOHN <RICHARDS at mailbox.sc.edu> wrote:
>
> I have a question about using “svd” to get a projection along the maximum variance in the filter.  The output of the leadfield matrix and eloreta, or other types of procedures, is a 3 x nvoxel x nchannels filter.  This can be multiplied by data to get the 3 x nvoxel x time data in source analysis.  To restrict the dipole direction to the max direction of the filter coefficients, the svd function is used.  For example, in ft_sloreta
>
> %  'projectmom'       = project the dipole moment timecourse on the direction of maximal power, yes/no
>
>    [u, s, v] = svd(filt * Cy * ctranspose(filt));
>     mom = u(:,1); % dominant dipole direction
>     filt = (mom') * filt;
>
>   % estimate the instantaneous dipole moment at the current position
>     dipout.mom{i,1} = filt * dat;
>
> in this case filter is 1 (maximal orientation) x nvoxel by channels, data is nchannels x time, so the output is nvoxel x time.
>
> So I have a couple of questions.
>
> 1—What is the function of the covariance matrix in the following:
>    [u, s, v] = svd(filt * Cy * ctranspose(filt));
>
>    I understand in some of the source computations the covariance of the prestimulus ERP is used and this gives source output relative to the prestimulus covariance.  We usually have ERP data and use the covariance of the prestimulus period.  We also have EEG data rather than ERP data, and the data are not timelocked, so we have been using the entire interval of the data for the covariance matrix. I don’t understand the function of the covariance matrix in this formula, and if it is appropriate to use the entire interval for the covariance matrix.
>
> We also make some transformations on the original data (sum over trials; or time-freq computations).  In these cases should we use the COV matrix from the original data, or recompute a new COV matrix for derivative data?
>
> 2—What about using this instead—which I have seen in a couple of place.  I think in the leadfield step one can use the maximum orientation rather than the 3-d orientation during the leadfield calculation, In this case the Cy would not be present, so this would be done instead
>
>    [u, s, v] = svd(filt);filter=u(:,1)’*filter;
>
> Then later in the program doing the source analysis
>     dipout.mom{i,1} = filter * dat;
> This would result in a 1 (max orientation) X nvoxel x time data.
>
> Any suggestions or information would be helpful.
>
> John
>
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202

```