Ticket #22 (assigned defect)

Opened 3 years ago

Last modified 3 years ago

fanofactor correct?

Reported by: voges Owned by: pierre
Priority: major Milestone: 0.2
Component: signals Version: trunk
Keywords: Cc:

Description

Checking the calculation of the FF (function fano_factor() in Neurotools.singnals of several poissonian spikeLists (generated with NEST) yield NOT 1, not even approximately.

But i think it should, due to FF = 1 + (n-1)c with c=CorrelationCoefficient?=0 for non-correlated spikeTrains and n=populationSize.

Attachments

fano_factor.py Download (0.5 KB) - added by pierre 3 years ago.

Change History

  Changed 3 years ago by pierre

  • owner changed from nvoges to pierre
  • status changed from new to assigned

Same thing, can you attach your code ? I just made this simple test, creating 100 cells at 5Hz, and the corresponding SpikeList objects and the result of the fano_factor() function yields 1 for this Population. I'll have a look

from NeuroTools import signals import numpy

spikes = [] nb_cells = 100 frequencies = nb_cells*[5] for idx in xrange(nb_cells):

param = 1./frequencies[idx] isi = numpy.random.exponential(param, 100) pspikes = numpy.cumsum(isi)*1000. # To convert the spikes_time in ms for spike in pspikes:

spikes.append((idx, spike))

spk = signals.SpikeList(spikes,range(10))

Then

spk.fano_factor(1)

1.01205554579

spk.fano_factor(5)

1.01831634446

spk.fano_factor(10)

1.05063268893

spk.fano_factor(100)

1.57403508772

Cheers,

Pierre

Changed 3 years ago by pierre

follow-up: ↓ 3   Changed 3 years ago by pierre

Code formatting is not working, see file attached.

in reply to: ↑ 2   Changed 3 years ago by apdavison

Replying to pierre:

Code formatting is not working, see file attached.

To format code, enclose it in triple curly brackets (see WikiFormatting), e.g.:

from NeuroTools import signals 
import numpy

spikes = [] 
nb_cells = 100
frequencies = nb_cells*[5]

 for idx in xrange(nb_cells):
    param = 1./frequencies[idx]
    isi = numpy.random.exponential(param, 100)
    pspikes = numpy.cumsum(isi)*1000. # To convert the spikes_time in ms for spike in pspikes:

    spikes.append((idx, spike))

    spk = signals.SpikeList(spikes,range(10))

  Changed 3 years ago by apdavison

  • milestone changed from 0.1 to 0.2

  Changed 3 years ago by LaurentPerrinet

  • summary changed from fanofactor corrcet? to fanofactor correct?
Note: See TracTickets for help on using tickets.