Inacurrate Number of Spikes While Using Random Netstim

Moderator: wwlytton

Post Reply
agmccrei
Posts: 12
Joined: Thu Sep 10, 2015 1:34 pm

Inacurrate Number of Spikes While Using Random Netstim

Post by agmccrei » Fri Nov 11, 2016 6:39 pm

Hello,

I am trying to run a parameter search by varying the number of excitatory and inhibitory synapses on a multi-compartment model as well as their corresponding presynaptic firing rates. It is also important that these presynaptic spikes occur at random times. For the presynaptic spike parameters (i.e. netstim parameters) I use the following for each of the synapses:

Code: Select all

tstop = 1000
netstim.number = 2 to 10 // Varied according to parameter search
netstim.interval = tstop/netstim.number
netstim.start = 0
and netstim.noise = 1
Unfortunately, I am finding that when I set the fractional randomness to 1 (i.e. netstim.noise), I occasionally get less presynaptic spikes than expected (i.e. according to the value declared by netstim.number versus the value obtained using netcon.record(vec)). Presumably this is because the values taken from the negative exponential distribution occasionally generate presynaptic spike times > tstop(?). Since this introduces inaccuracies in my parameter search, I need to find a way to circumvent this issue. Is there a quick and easy way to re-sample from the negative exponential distribution during events where the spike times exceed tstop (or any other potential fixes for this)?

My guess on how to do this would be to implement this somehow while putting together code for generating independent random spike streams, according to https://www.neuron.yale.edu/neuron/node/60. I haven't implemented independent random spike streams yet because my code is not parallelized and for any given simulation in the parameter search each synapse is assigned the same netstim parameters (i.e. it did not seem necessary). Any advice would be most helpful.

Thanks,

Alex GM

ted
Site Admin
Posts: 5057
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Inacurrate Number of Spikes While Using Random Netstim

Post by ted » Sat Nov 12, 2016 11:07 pm

agmccrei wrote:Unfortunately, I am finding that when I set the fractional randomness to 1 (i.e. netstim.noise), I occasionally get less presynaptic spikes than expected
You mean you got fewer spikes than you expected. Why would you expect to get even 1 spike in every run? Given a negexp distribution with mean ISI > 0, for any finite simulation duration there is a nonzero probability that no spikes at all will be observed during a run.

agmccrei
Posts: 12
Joined: Thu Sep 10, 2015 1:34 pm

Re: Inacurrate Number of Spikes While Using Random Netstim

Post by agmccrei » Sun Nov 13, 2016 4:54 pm

Thank you for your reply Dr. Carnevale.
You mean you got fewer spikes than you expected. Why would you expect to get even 1 spike in every run? Given a negexp distribution with mean ISI > 0, for any finite simulation duration there is a nonzero probability that no spikes at all will be observed during a run.
That is in fact the issue I'm having. Of course, it is not an issue with netstim; I just took for granted that if you assign a number of spikes to a synapse (i.e. netstim.number) that that synapse will have that many spikes during the simulation time window. It did not initially occur to me that introducing randomness in the ISIs might cause a nonzero probability of there being less spikes than what is declared in the netstim.number variable. Netstim seems to do what it is supposed to be doing, just not what I want it to do.

As an example, during one simulation with 50 synapses (each assigned 8 spikes in a 1000ms time window, with ISI = 1000/8 = 125 ms, and a netstim.noise of 1), only 35/50 synapses spiked 8 times. The lowest number of synaptic spikes during that simulation was 4. I understand why it is doing this, but I was wondering if there is a good strategy for forcing all of the synapses to spike the number of times prescribed by netstim.number, but at random times within a finite simulation duration.

Thanks,

Alex GM

ted
Site Admin
Posts: 5057
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Inacurrate Number of Spikes While Using Random Netstim

Post by ted » Sun Nov 13, 2016 9:15 pm

agmccrei wrote:I understand why it is doing this, but I was wondering if there is a good strategy for forcing all of the synapses to spike the number of times prescribed by netstim.number, but at random times within a finite simulation duration.
You do realize that what you are asking for is not what would be generated by an ensemble of afferrents whose ISIs are characterized by the negexp distribution? You're asking for more spikes over a finite interval than the negexp distribution would account for. A competent reviewer would object on the grounds that it violates the rational basis for assuming a negexp distribution in the first place. If that happens, you may find yourself repeating a lot of simulations, analysis, and figure preparation (not to mention the possibility of having to make substantive revisions to the observations and discussion sections of your paper(s)). Maybe you can get away with it for long enough to squeeze out a publication or two--some reviewers are careless, and not all journals have equally high standards. Besides, if nobody ever reads your paper(s), then the error will pass unnoticed. However, if your work otherwise has merit, sooner or later someone will notice the discrepancy.

But maybe I'm being too cautious. Maybe this abuse of the negexp distribution is widespread and has "respectable antecedents" in the computational modeling literature. If so, shame on them (the "respectable antecedents") for perpetrating something that, if not quite fraudulent, is definitely in the realms of carelessness or ignorance.

agmccrei
Posts: 12
Joined: Thu Sep 10, 2015 1:34 pm

Re: Inacurrate Number of Spikes While Using Random Netstim

Post by agmccrei » Mon Nov 14, 2016 1:12 am

In my scenario, the input spike train ISI statistics to the cell type that I am modelling are not characterized and so, it is not clear whether modelling them using random sampling from a negexp distribution is appropriate in the first place (since there are other potential ISI distributions - see references at end). Then again, I see now that trying to force all the spikes to occur within the time window would negate the use of sampling ISIs from any type of distribution. By this logic, it seems that I am (reasonably) stuck with synapses that occasionally spike less than I want them to.

This has me wondering about another potential option, however. Would it be possible to randomly sample spike times (instead of ISIs) from a uniform distribution that has the same length of the time window? When computing the intervals between sorted random values sampled from a uniform distribution of a finite length, the histogram distribution of the intervals looks similar to a negative exponential distribution (see quick Matlab code example below). However in this approach, the spike times would be independent of each other, which I'm thinking would also be incorrect to assume.

Code: Select all

x = rand(10000,1)*100000; % i.e. 10000 spike times in 100 seconds
figure(1); histogram(x)
figure(2); histogram(diff(sort(x)))
figure(3); histfit(diff(sort(x)),54,'exponential')
Image
Image
Image
---
Taken from Ostojic, 2011:
"Irregular firing in vivo is often thought of as a Poisson process, but a close examination of experimental recordings reveals a large variety of interspike interval (ISI) statistics. Here we focus on the shapes of ISI distributions, which have been found to range from narrow to bursting (Bair et al. 1994; Compte et al. 2003; Maimon and Assad 2009)."
References:
Bair W, Koch C, Newsome W, Britten K. (1994). Power spectrum analysis of bursting cells in area MT in the behaving monkey. J Neurosci. 14(5 Pt 1):2870-92.
Compte A, Constantinidis C, Tegner J, Raghavachari S, Chafee MV, Goldman-Rakic PS, Wang XJ. (2003). Temporally irregular mnemonic persistent activity in prefrontal neurons of monkeys during a delayed response task. J Neurophysiol. 90(5):3441-54.
Maimon G, Assad JA. (2009). Beyond Poisson: increased spike-time regularity across primate parietal cortex. Neuron. 62(3):426-40.
Ostojic S. (2011). Interspike interval distributions of spiking neurons driven by fluctuating inputs. J Neurophysiol. 106(1):361-73.

ted
Site Admin
Posts: 5057
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Inacurrate Number of Spikes While Using Random Netstim

Post by ted » Mon Nov 14, 2016 12:11 pm

NetStim produces events at times governed by negexp. If you want something else, use VecStim to generate events at precalculated times. VecStim is discussed in many threads, but this one is relatively recent and comprehensive:
viewtopic.php?f=16&t=3261

Post Reply