Hello,
I am trying to implement in neuron a very simple model composed of a network of N neurons, each being subject to 2 synaptic noises (one inhibitory, one excitatory)
those noises are implemented by 2 NetStim for each neuron
all the NetStim in my network are seeded by calling rng.discunif(0,32000) where rng is a Random object. rng 's seed is a parameter of the program
1- Is such a seeding of the NetStim good to assure independence of the NetStims ?
2- If I do 2 successive calls to run() inside my .hoc code, the statistics of the NetStim differ. I suppose this means the NetStim don't reset their generator. Is this correct ?
Thank you very much for your time !
Guillaume
many independent NetStims ?
Moderator: wwlytton
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: many independent NetStims ?
You will want to use the Random class's MCellRan4 generator. Read about it in the Programmer's Reference.guillaume wrote:Is such a seeding of the NetStim good to assure independence of the NetStims ?
http://www.neuron.yale.edu/neuron/stati ... #MCellRan4
NEURON's run() does not reset the random number generators. If you want to get the same results on each run (which is essential for debugging and general program development) it is necessary to seed the reseed the ACG or MLCG, or if you're using MCellRan4 the highindex must be restored to its original value. If you have multiple instances of the Random class, this must be done for each instance.If I do 2 successive calls to run() inside my .hoc code, the statistics of the NetStim differ. I suppose this means the NetStim don't reset their generator
Re: many independent NetStims ?
Thank you very much for your answer, but I'm unsure what I should do:
- do I need to tell NetStim to use MCellRand4 instead of using its default rng ?
- do I need to program another source of noise based on MCellRand4 ?
- do I just go:
rng = new Random()
rng.MCellRan4()
for i=0, netStimList.count()-1
{ netStimList.object(i).seed() = rng.uniform(0,32000) }
- do I need to tell NetStim to use MCellRand4 instead of using its default rng ?
- do I need to program another source of noise based on MCellRand4 ?
- do I just go:
rng = new Random()
rng.MCellRan4()
for i=0, netStimList.count()-1
{ netStimList.object(i).seed() = rng.uniform(0,32000) }
-
- Site Admin
- Posts: 6300
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: many independent NetStims ?
See if this helps: http://www.neuron.yale.edu/neuron/node/59