Menu

1) Trouble with contrast manager; 2) Understanding DCM-SCR output; 3) Confounding el. stimulation artefact;

Help
2018-07-22
2018-09-10
  • Ondrej Zika

    Ondrej Zika - 2018-07-22

    Hello,

    I have several interrelated issues/questions regarding DCM model of anticipatory SCR described in Bach et al. (2010) and its implementation in PsPM.

    1) I test ran the model on 1 session of 1 participant specifying a window for 1 anticipatory event. VB seems to do a decent job inverting the generative model but I don't fully understand some of the output. Particularly,
    a) I split the trials into 3 conditions (A,B,C) but the model runs as if each trial was its own condition, so in the contrast manager I see n (number of trials) 'conditions'. I understand that I can now split them to my conditions using the contrast manager, but I don't udnerstand why these should be specified beforehand.

    b) When assigning contrast values to individual regressors in the contrast manager, I don't see a field where I can actually do that. I am sure this is straight forward and it seems to be trivial for everybody else, but I cannot find it. I am refereing to a field where I'd enter the [0 1 -1 0 1 -1 ...] vector.

    2a) Loading the glm.mat to Matlab. I assume that the dcm.sn{1}.Xt matrix represent the 7 estimated hidden variables while dcm.sn{1}.yhat is the predicted SC. From the 7 rows, it's not clear which estimate is which. I suppose there should be:
    a) SCL baseline - neural signal
    b) spontaneous fluctutaion (SF) - neural signal
    c) SCR - neuroal signal
    and their RF convolved versions (4-6)
    But the 7th doesn't seem to be the yhat (overall estimated SC)
    Could you clarify what the 7 rows are?

    2b) In dcm.sn{1}.options.trlnames, why is every second cell empty?

    3) In my task I used electrical stimulation to the back of the participants' palm. The actual delivery was picked up by the scr as seen on shock event vs no-shock event plots. When I run the non-linear model I bet those shocks get interpreted as SRs. Is there a way within PsPM to specify such confounding event? The response is not unsimilar to a SR, although it has a shorter latency.
    If it's not possible, what approcah would you recommend? ICA and component removal?
    I am mostly interested in anticipatory activity, but I also have some questions regarding the outcome time.

    Thank you for your advice.

    Ondrej

     
  • Dominik Bach

    Dominik Bach - 2018-07-23

    Dear Ondrej

    I hope this will help you:

    (1) DCM runs on a trial-by-trial basis and is agnostic wrt to trial identity. If you specify trial names, they will merely be stored for later usage in the contrast manager. However, in the contrast manager, you can also manually select individual trials.

    In the contrast manager, you don't enter a contrast vector (unlike SPM) but select trials with the mouse. This can be tedious for DCM output. If you are familiar with matlab, I'd suggest using batch scripting and/or using the function pspm_con1 directly.

    (2) DCM uses 3rd order ODE systems, and the intermediate "hidden states" have no interpretation. Yhat is formed in the observation function, it is not part of the hidden states. The 7 rows refer to: 1-3 task-related SCR, 4-6 SF, 7 SCL fluctuations. See also f_SCR for explanations.

    To understand why every second trialname is empty, I'd have to see the DCM and the script that generated it - would you be able to provide that? (send via email if you don't want to post it publicly).

    (3) This is a tricky one. I see two ways forward. First, if the artefacts are very stereotypical, you may be able to use template-matching to remove them (outside PsPM). Second, you could set these periods to NaN in the data (or define a 'missing epochs' file for DCM), and if they are shorter than 2 s they will be simply ignored in the DCM inversion.

    Dominik

     
  • Ondrej Zika

    Ondrej Zika - 2018-07-23

    Dear Domink,

    thank you for promptly response.

    1) Thank you, I will do that.
    2) Thank you for clarifying. I think the empty cells were error in my code - I thought I was using different event files than I was. I am re-running it now and will send you the code if it persists.
    3) Yes, they are very stable within participants (but not between) and there are plenty of trials to create a robust template, so I might have a go at that.

    Thank you, again.

    Best,

    Ondrej

     
  • Ondrej Zika

    Ondrej Zika - 2018-08-04

    Hello again,

    re 3). I tried removing all data points from the stimulation (assigning them NaN). Since most responses generated by the stimulation seem to last <1 s I removed exactly 1 s.

    Runing the same anticipatory DCM analysis now only runs 7/29 subjects. The script loops through the enitre set but simply ignores (or crashes in background) most of them. I suspect that your reference to 2s window might be related but I am sure none of the trials had more than 1 s removed.

    Any idea what might be going on?

    Thank you,

    Ondrej

     
  • Dominik Bach

    Dominik Bach - 2018-08-05

    Hi Ondrej

    would you mind sending one of the files that crashes, and send me the code with which you call DCM, for investigation? If you don't want to post data publicly, send via email to the address provided in the toolbox start up.

    Best
    Dominik

     
  • Ondrej Zika

    Ondrej Zika - 2018-08-09

    And the script :) Please let me know if I missed something.
    Best wishes,

    Ondrej

     
  • Dominik Bach

    Dominik Bach - 2018-08-11

    Hi Ondrej

    thanks for sending this. I tried to run your script, and I noted you had turned off the warning messages.

    After commenting out this line, I received a warning that the first data file could not be loaded.

    When I load this file into the workspace I note that the amount of data in channels 1-3 does not match the file duration specified in infos.duration. This makes the file invalid. All channels in PsPM need to have the same recording duration, and PsPM takes care of this during import.

    How did you import the data? Using PsPM functions or your own scripts?

    Best
    Dominik

     
  • Ondrej Zika

    Ondrej Zika - 2018-09-03

    Dear Dominik,

    thank you for your feedback. I did import the data using pspm however, I also did quite a bit of custom work on it - e.g. trimming. I will go over the scripts to check where is this discreprancy coming from.

    Thank you.

    Ondrej

     
  • Ondrej Zika

    Ondrej Zika - 2018-09-03

    Dear Dominik,

    thank you for your feedback. I did do part of the preprocessing manually and I found the bug. The analysis now runs smoothly.

    Thank you.

    Ondrej

     
  • Ondrej Zika

    Ondrej Zika - 2018-09-06

    Hello,

    I would like to come back to the issue #3 - shock spikes in the signal. SInce they last between 0.3 and 0.8 s I removed 1s (all shorter than 2s) from each shock delivery, simply replacing the data points with NaNs.
    I then ran the non-linear DCM. Everything seems to run fine but some rows in dcm.stats have NaN values in them, so as a consequence all contrasts get assigned a NaN. Is there a way to tell contrast manager to ignore some betas? I know this is possible at the level of the first level but it would seem odd to run the analysis once just to identify which epochs output NaN and then re-run it with them marked as missing epochs. If there is no other way that's what I will do.

    I have few other remarks/questions

    I) When I run the contrast manager on a model that already had some contrasts calculated the new contrasts are appended rather than overwritten. This can be tricky in case someone misses it. I couldn't find a mention of this in the documentation.

    II) In noticed that the order of events changes between dcm.condnames and dcm.trlnames. Does the contrast manager use the earlier or the latter?

    Thank you.

    Ondrej

     
  • Dominik Bach

    Dominik Bach - 2018-09-08

    Hi Ondrej

    thanks for the feedback.

    Regarding the handling of NaN stats by the contrast manager, this is a very good point, and thanks for brining it up. The feature that leads to these NaN values is quite new, and we haven't followed the consequences through the contrast manager. We'll take care of this shortly and provide an update. In the meantime, the easiest solution would be to simply do the contrasts outside PsPM in Matlab, by loading the model, extracting dcm.stats, and simply averaging within conditions, then compute contrasts between conditions.

    Regarding the other points:
    (I) There is a box 'delete existing contrasts' in the contrast manager GUI, and a similar field in the Matlabbatch GUI. Does it not work?
    (II) That depends on whether you define the contrast to work on trials or on conditions. You can always load the dcm.stats and define a test contrast to compare, if you are unsure. Or more easily, go through the contrast manager GUI (called directly from the red main GUI, rather than through Matlabbatch) which should show you the condition names if you choose 'conditions', and then you can compare this with a batch script result.

    Hope this helps
    Dominik

     
    • Ondrej Zika

      Ondrej Zika - 2018-09-10

      Hello,

      thank you for your response.

      I bypassed the NaN issue by including the code below in pspm_con1 for now:
      It's not quite as elegant but it does the job.

      I) You are right. It works.
      II) Thank you. That's a nice way of checking.

      Many thanks!

      All the best,

      Ondrej

      conval = conmat * data.stats;
      if sum(sum(isnan(conval)))>0
          disp('Deviating from standard PsPM code!! Temporary fix in pspm_con1');
          conval = [];
          for bc = 1:size(data.stats,2)
              for c = 1:size(conmat,1)
                  conval(c, bc) = nansum(conmat(c,:)' .* data.stats(:,bc));
              end
          end
      end
      
       

      Last edit: Ondrej Zika 2018-09-10

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.