general-discussion >

**CompCor results**Showing 1-3 of 3 posts

Jul 20, 2014 03:07 AM | chiara di stefano

CompCor results

Dear Dr Bellec,

Thank you for your answer..So I've some other questions:

Best,

Chiara D.S.

Thank you for your answer..So I've some other questions:

- when you talk about "slow time drift", it means the same of my "linear trend"?
- What do you mean with "polynomial do not scale well with the length of the signal"? I would like to discuss about this problem in my thesis, so I'll be grateful if you could tell me something else.
- if I well understood, the code Niak_filter_tseries generates covariates (discrete cosines) that stand for the linear trend regressors. Can you show me some lines as example of code usage? I used the code with opt=struct('flag_mean',false,'tr',0.295,'hp',-Inf,'lp',Inf); and I obteined empty "extra" structure. Then I tried with lp=1 and I obteined EXTRA.TSERIES_DC_HIGH as a 2D array of time x 370 elements.Have I to regress all in the GLM?

Best,

Chiara D.S.

Jul 21, 2014 06:07 AM | Pierre Bellec

RE: CompCor results

Dear Chiara,
Slow time drifts is a loose term for any slow fluctuations in the
time series. It includes linear, quadratic or cubic trend, and low
frequencies (typically <0.01 Hz).
If you use a polynomial model for slow time drifts, say linear and
quadratic, you will have two regressors regardless of the duration
of your time series. If you have 5 mns of signal, the
linear/quadratic trend will correct for drifts at this time
scale, while if you have an hour of signal thay will correct for
comparatively much, much slower variations. And drifts at the 5 mns
scale will essentially remain uncorrected. This is why in fmristat
for example, a new set of linear/quadratic trend are introduced for
every 5 mns or so time block. But this is very much of a hack. With
standard filtering approach, the number of discrete cosines
covering the [0 , 0.01] Hz frequency band will vary with the length
of your signal: longer time series translate into higher spectral
resolution, and so more covariates to regress. This approach
naturally adjusts the complexity of the model for slow time drifts
as a function of the duration of the signal.
The cosines corresponding to slow frequencies are in
"extra.tseries_dc_low". I am surprised that you have 370 elements,
but you also entered a TR of 0.295 seconds, so I assume this is
some fancy multiband data with tons of time points, so it may make
sense. I've added an example in the help of niak_filter_tseries, if
you clone the head of niak on github.com/SIMEXP/niak. I've
copy/pasted it below for your convenience:

tseries = randn([128,20]) + ([0:127]'/127)*rand([1 20]); % simulate time series with linear drift

opt.tr = 3;

opt.hp = 0.01;

opt.lp = Inf;

[tseries_f,extras] = niak_filter_tseries(tseries,opt);

ftseries = fft(tseries);

ftseries_f = fft(tseries_f);

figure

subplot(1,2,1)

slow_drifts = extras.tseries_dc_low * extras.beta_dc_low;

plot(0:3:(3*127),[tseries(:,1),tseries_f(:,1),slow_drifts(:,1)]);

legend({'example raw signal','example filtered signal','slow drift'})

subplot(1,2,2)

plot([0:1/(3*128):1/6],[mean(abs(ftseries(1:65,:)).^2,2) mean(abs(ftseries_f(1:65,:)).^2,2)]);

legend({'Average power spectrum','average filtered power spectrum'});

figure

plot(extras.tseries_dc_low)

title('the low-frequency discrete cosines');

I hope this helps,

Pierre

- when you talk about "slow time drift", it means the same of my "linear trend"?

- What do you mean with "polynomial do not scale well with the length of the signal"? I would like to discuss about this problem in my thesis, so I'll be grateful if you could tell me something else.

- if I well understood, the code Niak_filter_tseries generates covariates (discrete cosines) that stand for the linear trend regressors. Can you show me some lines as example of code usage? I used the code with opt=struct('flag_mean',false,'tr',0.295,'hp',-Inf,'lp',Inf); and I obteined empty "extra" structure. Then I tried with lp=1 and I obteined EXTRA.TSERIES_DC_HIGH as a 2D array of time x 370 elements.Have I to regress all in the GLM?

tseries = randn([128,20]) + ([0:127]'/127)*rand([1 20]); % simulate time series with linear drift

opt.tr = 3;

opt.hp = 0.01;

opt.lp = Inf;

[tseries_f,extras] = niak_filter_tseries(tseries,opt);

ftseries = fft(tseries);

ftseries_f = fft(tseries_f);

figure

subplot(1,2,1)

slow_drifts = extras.tseries_dc_low * extras.beta_dc_low;

plot(0:3:(3*127),[tseries(:,1),tseries_f(:,1),slow_drifts(:,1)]);

legend({'example raw signal','example filtered signal','slow drift'})

subplot(1,2,2)

plot([0:1/(3*128):1/6],[mean(abs(ftseries(1:65,:)).^2,2) mean(abs(ftseries_f(1:65,:)).^2,2)]);

legend({'Average power spectrum','average filtered power spectrum'});

figure

plot(extras.tseries_dc_low)

title('the low-frequency discrete cosines');

I hope this helps,

Pierre

Thank you for your time.

Best,

Chiara D.S.

Best,

Chiara D.S.