[pymvpa] modifying time_attr and onset when running fit_event_hrf_model with a dataset truncated at the beginning

Yaroslav O Halchenko yoh at onerussian.com
Fri Jan 25 21:46:22 GMT 2019


On Fri, 25 Jan 2019, Ben Smith wrote:

>    Hi all,

>    I have a dataset with TR=2 where I want to delete the first 10 TRs (first
>    20 seconds) before running fit_event_hrf_model.

>    Deleting the first TRs is easy:

>    ds = ds[10:]

>    However I am unsure what to do with time coordinates. I understand that if
>    I adjust the onsets in the event list then I will also need to adjust the
>    time_attr in the dataset, like:

>    TR=2
>    for e in event_list:
>        e['onset'] = e['onset']-10*TR
>    ds = ds.sa.time_coords - 10 * TR
>    result= fit_event_hrf_model(ds, event_list, time_attr='time_coords',
>                                                       
>     condition_attr=('targets', 'chunks'))

>    My intuition is that it shouldn't matter whether you adjust event onset
>    and ds time coordinates as long as you adjust both or neither - so that
>    they stay correctly aligned.

sounds true to my understanding too

>    But when I run this and test, then I do get slightly different estimates
>    depending solely on whether I adjust the both time coordinates and event
>    onsets, or neither (keeping constant the removal of 10 trs).

hm, if anything, I would trust the one where you do remove since may be
there is some hardcoded assumption of time to start from 0?

anyways -- first step might be to check  your .sa.regressors you get
from both solutions -- do they look as expected or which one is screwed
up?

-- 
Yaroslav O. Halchenko
Center for Open Neuroscience     http://centerforopenneuroscience.org
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        



More information about the Pkg-ExpPsy-PyMVPA mailing list