Dear Ricardo,
The mean can certainly be removed during bandpass filtering at any stage in the preprocessing. In terms of the inversion of the DCM, this can be enforced by having a constant (mean) term specified as a confound (in turn, this is specified by the order of the trending in the GUI). for example, in spm_dcm_erp:
% confounds - DCT: (force a parameter per channel = activity under x = 0)
%--------------------------------------------------------------------------
if h == 0
X0 = zeros(Ns,h);
else
X0 = spm_dctmtx(Ns,h);
end
T0 = speye(Ns) - X0*((X0'*X0)\X0');
xY.X0 = X0;
where spm_dctmtx(Ns,1) returns a column of a constant (mean).
I hope that this helps.
Very best wishes – Karl
________________________________________
From: [log in to unmask] [[log in to unmask]] on behalf of Ricardo Pizarro [[log in to unmask]]
Sent: 22 April 2013 20:29
To: Friston, Karl
Subject: Re: Using spm_nlsi_GN in the forward direction
Hey Karl,
I have another question regarding DCM modeling. It seems that
somewhere in the cascading call of functions, the mean of the modeled
waveform is subtracted. I can say this because I have tried to
introduce an offset to set the prestim mean to zero. Is there a place
in the code that the mean is removed from the waveform or a hpf is
used? Thanks again for your help. All the best,
-Ricardo
On Tue, Apr 9, 2013 at 10:59 AM, Friston, Karl <[log in to unmask]> wrote:
> Dear Ricardo,
>
>
>
> Thanks again for your tireless help! Just a couple followup questions:
>
>
>
> 1. Are there meaningful units on the input? I have been using DCM.xY.scale
> to appropriately scale the predicted waveforms to plot against recorded
> waveforms. Does this translate to the input as well?
>
>
>
> No - the data scaling is used to ensure there is a rough match between the
> units of the data, the units of the lead field and the amplitude of the
> predicted responses. The input is scaled (arbitrarily) to a maximum 32.
> The input is rescaled in the equations of motion of the neural mass models
> to produce an ERP of about 1 arbitrary unit (assuming the lead field is 1).
>
>
>
> 2. Related to the input. Is it possible to change the input waveform
> (amplitude, offset, different shape?). Also is it possible to change the
> location of which layer the input stimulates
>
>
>
> Yes - but you would have to change the spm_erp_u.m routine (e.g, to make
> them sustained inputs) and the appropriate equations of motion (e.g.,
> spm_fx_erp)
>
>
>
> With very best wishes,
>
>
>
> Karl
>
>
>
>
>
> On Tue, Apr 9, 2013 at 7:50 AM, Friston, Karl <[log in to unmask]> wrote:
>
>> Dear Ricardo,
>
>>
>
>>
>
>>
>
>> It's been a while since I've emailed you but I have been busy as I'm
>
>> sure you have as well. I am still not able to find the answers to a
>
>> few questions regarding how DCM works:
>
>>
>
>>
>
>>
>
>> 1. Is there a way to save the input that is computed "on the fly" as
>
>> you said above? I would like to plot this input versus time to
>
>> compare to the other waveforms. Is that possible?
>
>>
>
>>
>
>>
>
>> Yes – in fact this is done for you by the routine that reviews the
>> results:
>
>> - just type >> spm_dcm_erp_results(DCM,'Input');
>
>>
>
>> One can also compute it oneself using:
>
>>
>
>>
>
>>
>
>> t = DCM.xY.pst;
>
>>
>
>> t = t - t(1);
>
>>
>
>> U = spm_erp_u(tU/1000,DCM.Ep,DCM.M);
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> 2. Vladimir told me DCM averages the epochs into a single waveform
>
>> before running its optimization algorithm. Is this correct? Does DCM
>
>> optimize its solution on all epochs or a single average?
>
>>
>
>>
>
>>
>
>> It fits a single waveform that can be a single trial but is more
>
>> usually a trial average (ERP).
>
>>
>
>>
>
>>
>
>> 3. Does the DCM struct file keep convergence information anywhere? I
>
>> see when DCM is running it iterates through many steps until either
>
>> convergence happens or the number of steps ends. Does the struct file
>
>> keep any of this information stating on which step convergence occurred if
>> at all?
>
>>
>
>>
>
>>
>
>> No – but it would be relatively easy to place this information in the
>
>> structure - you would have to pass it from spm_nlsi_GH to DCM.mat
>
>>
>
>>
>
>>
>
>> 4. Related to (3) can we use a model that worked in a particular case
>
>> to start the estimation for another set of data? That is, we used DCM
>
>> to predict waveforms recorded from different channels and it works
>
>> reasonably well in many channels but fails to converge in a couple of
>
>> cases. Can we use the model estimated for one set of channels to
>
>> start the modeling for the case that failed? We think this could help
>
>> DCM to start from a better location and it may not "get stuck" on what is
>> known as "local minimum."
>
>>
>
>> In other words, how can we use our own set of initial conditions,
>
>> parameters.
>
>>
>
>>
>
>>
>
>> Yes – this is common practice in group subjects, in which a few
>
>> subjects do not converge. This entails placing the initial parameters
>
>> in DCM.M.P. At the bottom of the GUI (spm_api_erp) there is a button
>> called ‘initialise’
>
>> that allows you to do this automatically.
>
>>
>
>>
>
>>
>
>>
>
>>
>
>> 5. How is latency in the waveforms modeled with T(:)? Are these
>
>> values able to be changes as well?
>
>>
>
>>
>
>>
>
>> Yes, they are. The prior expectation is set by DCM.M.ons and this is
>
>> adjusted using a free parameter (not pE.T but pE.R: pE.T sets the time
>
>> constants for variance synaptic responses)
>
>>
>
>>
>
>>
>
>> I hope this helps.
>
>>
>
>>
>
>>
>
>> With very best wishes - Karl
>
>>
>
>>
>
>
>
>
>
>
>
> --
>
> Ricardo Pizarro
>
> ---------------------------------
>
> Graduate Research Assistant, Meyerand Lab Department of Biomedical
> Engineering Wisconsin Institutes for Medical Research University of
> Wisconsin-Madison
>
> 1111 Highland Avenue
>
> Madison, WI 53705-2275
>
> ---------------------------------
>
> Cel: (301)602-0692
>
> Email: [log in to unmask]
>
>
|