bachlab / PsPM

A matlab suite for Psycho-Physiological Modelling
GNU General Public License v3.0
43 stars 11 forks source link

Error in event definition #762

Closed cretecht closed 2 months ago

cretecht commented 2 months ago

Summary

Hello, I'm developing a DCM for a fear conditioning task. In the task, for every event participants are placed in a context (constant across a session) and for ~3.7s view a bag (CS), then a snake (US) may or may not pop out of the bag. Any such event has a duration of ~4.5. There are three bags presented differing in color for a given task session and each bag may or may not have a snake inside of it (CS+ or CS- for colors C1, C2, or C3).

Following the tutorial in the PsPM Manual, I tried to model the events in the GUI first to specify a DCM similar to the tutorial's non-linear model specification, although I manually created the timing info. I provided a snippet for the GUI as well as the file I'm using. I started by creating 6 events: 3 CS+ events with flexible response windows and 3 US events with fixed responses (see first attached imaged). All other settings are defaulted. I encountered the error in the first image below.

The timings for the events are in the adjacent command window. The USs are the variables named "e". As can be seen, the timings don't overlap. Although, I wonder if this is an inversion issue related to consecutive events being inverted concomitantly and would I need to adjust the inversion options?

Once I remove the third stimulus (CSA+), this issue is resolved. Removing either of the other stimuli doesn't resolve this issue. Is there any advice on resolving this issue besides what I've eluded to above?

PS

image pspm_Subj005a21.zip

Technical Info

dominikbach commented 2 months ago

Could you save the batch script from the matlabbatch GUI and send it, so I can reproduce and trouble-shoot?

Dominik

cretecht commented 2 months ago

Sure thing, I've included below NOTE: Removed file

I was able to specify a model successfully following exactly the dcm tutorial's steps in constructing a timing file.

dominikbach commented 2 months ago

In the script that you sent, there are 3 flexible events for 6 trials, and 3 fixed events for 4 trials. However, all trials must have the same number of events. That is, you need to define US events even when no US occurs - and separate them into US_present and US_absent after model estimation.

cretecht commented 2 months ago

I see. I think the timing file is a good choice for implementing it. One thing I did encounter when trying to implement it is the CS- condition naming compared to the CS+|US- and CS+\US+ conditions. I'm able to implement the CS+|US+ and CS+|US- condition naming but not the CS- condition naming. It throws the event definition error as well. I've provided the batch script and event timing files below.

Could describe why those are added in the dcm tutorial? test_batch_005acq.zip

dominikbach commented 2 months ago

In the event definition you sent, there are several overlapping trials (e.g. one flexible event ending at 89.770 s and the next starting at 89.1150 s). This means I cannot reproduce the problem with trial names.

In any case, DCM does not require trial names. This is only a convenience option for housekeeping - you can use them down the line (e.g. for exporting or extracting average responses) but you don't have to.