Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168703
Image: ubuntu2004

Binomial calculations for Pouille et al., 2009

Jose Guzman(*) and Rajiv Kumar Mishra

version 1.0.2

March 1, 2010

(*) Please send any suggestions or comments to [email protected]


Index

Scanziani's paper (Pouille et al., 2009) provides a simple example to calculate the number of active presynaptic terminals based on binomial analysis. The number of postsynaptic neurons envolved in a network can be calculated given the probability of connection between pre and postsynaptic neuron, and the number of presynaptic terminals recruited. If we know the number of inputs that a postsynaptic cell needs to be recruited (convergence) we can simply calculate the number of postsynaptic neurons that will be active by the number of terminals recruited.

import numpy as np from scipy.stats import binom # import binomial distribution (it is a discrete distribution!!!)
# example of binomal calculation rv = binom(5,0.15) rv.pmf(4) # table is .0022
0.0021515625000000371

Scanziani's example is as follows. If presynaptic neurons connect to a postsynaptic population with a probability of 15% and each postsynaptic cell requires 40 active inputs to be recruited, then 2% of the postsynaptic cells would be recruited by the activity of 200 presynaptic neurons and almost all (>99%)would be recruited by simply doubling the number of active presynaptic neurons.

We create a binomial distribution

$Pr(N=k) = \dbinom{N}{k}p^{k}(1-p)^{(N-k)}$

presynaptic terminals, p is the probability of connection and k is the number of terminals required to fire a cell . This binomial distribution has the values N=200, x = 40 and p = 0.15. We can plot the binomial distributions for values between 0 and 60 sucessfully trials.

rv = binom(200,0.15) # N = 200, p = 0.15 CDF = [rv.cdf(i) for i in range(60)] # cumulative density function PDF = [rv.pmf(i) for i in range(60)] # probability mass/density function figure = list_plot(PDF, plotjoined=True) xlabel=text('Number of recruited terminals',(30,-0.010),rgbcolor='black',fontsize=12) figure += xlabel figure.fontsize(14) figure.show()
#print PDF[1] # this gave 2.70077e-13 in Mathematica print rv.pmf(40)
0.0115469107154

To calculate the probability that 40 or more presynaptic terminals will be activated we have to plot the cumulative density function.

figure = list_plot(CDF, plotjoined=True) xlabel = xlabel=text('Number of recruited terminals',(30,-0.15),rgbcolor='black',fontsize=12) figure += xlabel figure.fontsize(14) figure.show(ymin=-0.10)

Now we know to calculate how many presynaptic cells (N) need to be recruited so that the 2% of the postsynaptic cells are active.

1-binom(200,0.15).cdf(40)
0.021999274880182607

Note that if we double the number of presynaptic terminals active (N=400), the probability of getting 40 or more active terminals change to almost 100%.

1-binom(400,0.15).cdf(40)
0.9978570650962616

Now we plot everything

# Plot probability density functions for N= 200 and N = 300 n200 = [binom(200,0.15).pmf(i) for i in range(0,100)] n400 = [binom(400,0.15).pmf(i) for i in range(0,100)] fig1 = list_plot(n200, plotjoined = True, rgbcolor = 'blue') fig2 = list_plot(n400, plotjoined = True, rgbcolor = 'red') xlabel = text('Number of recruited presynaptic terminals',(50,-0.015),rgbcolor='black',fontsize=12) thline = line([(40,0),(40,0.08)], rgbcolor = 'gray', linestyle = '--') text200 = text('N=200',(80,0.065),rgbcolor = 'blue', fontsize = 12) text400 = text('N=400',(80,0.060),rgbcolor = 'red', fontsize = 12) figure = fig1 + fig2 + xlabel + thline + text200 + text400 figure.fontsize(14) figure.show(ymin=-0.01)
# Plot cumulative functions p200 = [binom(200,0.15).cdf(i) for i in range(0,100)] p400 = [binom(400,0.15).cdf(i) for i in range(0,100)] fig1cmd = list_plot(p200, plotjoined = True, rgbcolor = 'blue') fig2cmd = list_plot(p400, plotjoined = True, rgbcolor = 'red') xlabel = text('Number of recruited presynaptic terminals',(50,-0.20),rgbcolor='black',fontsize=12) text200 = text('N=200',(85,0.85),rgbcolor = 'blue', fontsize = 12) text400 = text('N=400',(85,0.75),rgbcolor = 'red', fontsize = 12) thline = line([(40,0),(40,1)], rgbcolor = 'gray', linestyle = '--') figcum = fig1cmd + fig2cmd + xlabel + text200 + text400 + thline figcum.fontsize(14) figcum.show(ymin=-0.10)
# now we calculate how many cells are active if we double (N=200) the number of presynaptic terminals (1-binom(400,0.15).cdf(40))*100
99.785706509626166
# we can try to calculate how many cells do we need to get a 2% postsynaptic cell activation # create a function def mybinom(N): return 1-binom(N,0.15).cdf(40) from scipy.optimize import fsolve fsolve(lambda N: mybinom(N)-0.020,100)
Warning: The iteration is not making good progress, as measured by the improvement from the last ten iterations. 199.5458489705228
int(round(fsolve( lambda N: mybinom(N)-0.02,100, warning = False)))
200