Stimulatus applied on surface produced unrealistic result

90 views
Skip to first unread message

Nephiloso Wu

unread,
Jun 22, 2022, 2:39:13 PM6/22/22
to TVB Users
Dear all,

I'm doing a surface-based modeling with a stimulus. I isolated the left-primary visual cortex from the default 16k surface, which contains 177 nodes/vertices in total. The model for each node is WilsonCowan. The following is my stimulus scheme:
```
stimulation = True
stim_size = 8
dt = 0.1
if stimulation:
    # Define a spatial pattern
    # Define a stimulus
    eqn_t = equations.Alpha()  # belongs to a family of exponential function, used for visual stimulus
    eqn_t.parameters['onset'] = 200  # ! Time point of stimulus onset
    eqn_t.parameters['alpha'] = 43
    eqn_t.parameters['beta'] = 12
   
    eqn_s = equations.DiscreteEquation()
   
    deck = list(range(1, default_cortex.surface.number_of_vertices))
    random.shuffle(deck)
    focal = np.array(deck[:stim_size])
    stimulus = patterns.StimuliSurface(surface=default_cortex.surface,
                                       focal_points_triangles=focal,
                                       temporal=eqn_t,
                                       spatial = eqn_s)
    stimulus.configure_time(np.arange(0.,500, dt))  # apply a stimulus at 25s
```
Then I found two unusual things:
1. When I plot stimulus._temporal_pattern to check the temporal sequence, I found that changing `dt` from 0.1 to 1 will dramatically change the scale of the alpha function. The peak of dt=1 is ~4e-5, while the peak of dt=0.1 is ~5. (also see fig 1 and 2) How can the functions be so different when eqn_t.parameters are all fixed?
temporal_dt0.1.png
fig.1 alpha function when dt=0.1
temporal_dt1.png
fig.2 alpha function when dt=1

2. I plotted the simulation and found that the y value, which is the average firing rate of the excitatory population, rises to 15 after the stimulation is applied. This is an unrealistic result because the firing rate would never go beyond [-1,1]. (fig.3) I used HeunDeterministic as a integrator and SpatialSverage as a monitor.
simulation_outcome.png
Besides, if anyone could provide any literature about the alpha function that relates to modeling I would greatly appreciate it. Personally I didn't find anything... This is what it looks like: alpha_function.png

Best regards,

Peixuan

WOODMAN Michael

unread,
Jun 27, 2022, 5:35:04 AM6/27/22
to TVB Users

hi,


Just to check, (1) are you sure the peaks aren't 4e-5 and 5e-5 respectively? your figure seems to be cut off.  otherwise, indeed it may be a bug to look into, as dt should not affect the alpha function value beyond discretisation error. 


(2) In this model, the firing rates aren't bound, so they can exceed those limits in some circumstances such as a very strong stimulus.


Lastly, the alpha function is well known in computational neuroscience in synaptic modelling. This chapter may be of use 


https://web.njit.edu/~horacio/Math451H/download/ErmentroutTerman_Chapter7.pdf


cheers,

Marmaduke


From: tvb-...@googlegroups.com <tvb-...@googlegroups.com> on behalf of Nephiloso Wu <neph...@gmail.com>
Sent: Wednesday, June 22, 2022 8:39:12 PM
To: TVB Users
Subject: [SUSPECTED SPAM] [TVB] Stimulatus applied on surface produced unrealistic result
 
--
You received this message because you are subscribed to the Google Groups "TVB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tvb-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tvb-users/0b89496f-98c3-45c7-8274-de4e47e62739n%40googlegroups.com.

Nephiloso Wu

unread,
Jun 27, 2022, 3:38:12 PM6/27/22
to TVB Users
Hi Marmaduke,

Thank you for your reply and the book chapter! Yes, I have double-checked. The peak of dt=0.1 is  4.78, but the peak of dt=1 is  0.000102. The exact number is not the same as the figure above because I changed the parameter of the Wilson-Cowan model, but the scale is similar to the above.

Also, I just found that the peak of the power spectrum (PSD) of the signal changes as the `dt` changes. For example, under the same parameter setting of Wilson-Cowan model, the PSD peak of dt=0.5 is at 7.8125 Hz, while the peak of dt=1 is at 25.87890625Hz. This also looks wired to me. Could it be the Stochastic integration scheme that causes the problem?

Thanks,

Peixuan

NeuroLife

unread,
Jun 27, 2022, 9:03:28 PM6/27/22
to TVB Users
Hi,

I may be wrong, but I believe that the noise is not scaled to match the dt in the stochastic integration scheme. Which means that as you decrease the dt you also increase the amount of noise in the integration over all. Since the PSD tends to shift towards the lower frequency range (and flatten a bit) with increased noise perhaps what you observe is the consequence of increased noise. Though such radical changes like going from 25.9Hz all the way down to 7.8Hz is not something that I have seen a lot from increasing the noise alone. An easy way to verify if it is the noise causing the issue would be to reduce the noise parameter values by half for the dt=0.5ms and see if the results match the dt=1.0ms. Also, if it is the noise I would also expect the PSD at dt=0.5ms to have much less power in its peak maximum.

Hope this helps.
Dominic Boutet

WOODMAN Michael

unread,
Jun 28, 2022, 3:32:42 AM6/28/22
to TVB Users

hi,


> the noise is not scaled to match the dt in the stochastic integration scheme


The stochastic schemes scale the noise by sqrt(dt) which can be found in any reference on stochastic differential equations such as Higham 2001


https://epubs.siam.org/doi/pdf/10.1137/S0036144500378302


and in the code here


https://github.com/the-virtual-brain/tvb-root/blob/master/tvb_library/tvb/simulator/noise.py#L201


> as you decrease the dt you also increase the amount of noise in the integration over all


The number of random samples used for simulation does increase when decreasing dt, but if that induces a radical change, then there is likely a convergence issue with the larger value of dt.  In other words, the features of the model that are of interest, should be invariant with respect to dt, once dt is small enough.


> For example, under the same parameter setting of Wilson-Cowan model, the PSD peak of dt=0.5 is at 7.8125 Hz, while the peak of dt=1 is at 25.87890625Hz.


Can you share the code (privately if you wish) to reproduce this please?


cheers,

Marmaduke



From: tvb-...@googlegroups.com <tvb-...@googlegroups.com> on behalf of NeuroLife <domin...@hotmail.com>
Sent: Tuesday, June 28, 2022 3:03:28 AM
To: TVB Users
Subject: [RESEAUX SOCIAUX] Re: [SUSPECTED SPAM] [TVB] Stimulatus applied on surface produced unrealistic result
 

NeuroLife

unread,
Jun 28, 2022, 11:24:45 AM6/28/22
to TVB Users
Ah, I see. I missed that rescaling with sqrt(dt) when looking at the code, thanks!
Reply all
Reply to author
Forward
0 new messages