︠981d85fe-58bb-4e35-96e1-7d51b8dd508ei︠ %html

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 nin@neurohost.org


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.

︡2958483e-17be-4d7d-ba76-b5e7763a4959︡{"html": "

Binomial calculations for Pouille et al., 2009

\n

Jose Guzman(*) and Rajiv Kumar Mishra

\n

version 1.0.2

\n

March 1, 2010

\n

(*) Please send any suggestions or comments to nin@neurohost.org

\n
\n

Index

\n

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.

"}︡ ︠283714c9-2b1a-449f-8ed8-3f6f4f013a18︠ import numpy as np from scipy.stats import binom # import binomial distribution (it is a discrete distribution!!!) ︡7aacc2a3-229c-4d04-91fc-fb5a16320a12︡︡ ︠4ded952a-e87b-439e-bb88-15298f483ec4︠ # example of binomal calculation rv = binom(5,0.15) rv.pmf(4) # table is .0022 ︡aa1fc288-0df7-4bbc-8fea-34aa471b1ff3︡{"stdout": "0.0021515625000000371"}︡ ︠2150d879-e1c1-4036-92ef-f698f70c8c24i︠ %html

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.

︡3d28b65b-b333-4b94-b4f4-c4289799b729︡{"html": "

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.

\n

We create a binomial distribution

\n

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

\n

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.

"}︡ ︠ca567dd3-bb8c-4c8b-8681-28ea59818f43︠ 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() ︡bfe04695-b9c5-40a1-ae31-7e0233a971ce︡{"html": ""}︡ ︠5d7edb48-8598-4438-928e-bcb00b2fce60︠ #print PDF[1] # this gave 2.70077e-13 in Mathematica print rv.pmf(40) ︡2e637056-7f26-4d91-bde5-2029a5b16b8a︡{"stdout": "0.0115469107154"}︡ ︠80d00c3a-edfa-4e07-91f2-14d566511716i︠ %html

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

︡156431f4-d872-403c-a1f2-c9b1e6f06538︡{"html": "

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

"}︡ ︠3b499547-9c09-4888-9baf-9d110116f6ad︠ 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) ︡61f72bb5-350c-465b-b5b7-c05b3641b565︡{"html": ""}︡ ︠620cced4-fe7f-40bd-a1f5-21dca7b565f4i︠ %html

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

︡4c65e2ec-038e-4255-b278-da0794281f9b︡{"html": "

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

"}︡ ︠748cb1bd-a573-4b2f-b246-31ab0f21f8dc︠ 1-binom(200,0.15).cdf(40) ︡9c32605e-2b07-4bc6-948a-345e1fd72c63︡{"stdout": "0.021999274880182607"}︡ ︠7b56a2d0-c141-4496-ba82-21472166a9e0i︠ %html

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%.

︡ea821b4d-3ae1-4995-95c0-2321a16a1576︡{"html": "

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%.

"}︡ ︠8d06822f-ac85-46e7-b277-89d1ab8be9c8︠ 1-binom(400,0.15).cdf(40) ︡88ebdd9f-558f-4948-b976-2314329e0286︡{"stdout": "0.9978570650962616"}︡ ︠302e1c91-a994-4b0e-b0a7-0982044981b3i︠ %html

Now we plot everything

︡5a8f049f-28ca-4786-90af-4deab6571bc2︡{"html": "

Now we plot everything

"}︡ ︠33b74d2e-6eae-483a-ab03-a50978532f85︠ # 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) ︡2b7f7eff-598b-4a32-8b56-c95e28676515︡{"html": ""}︡ ︠bcc25986-f41c-407a-a44f-3464563cacbd︠ # 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) ︡87f743d2-4989-41eb-b351-19503572e83a︡{"html": ""}︡ ︠08f7634d-db68-401b-b130-34ec90e124a0︠ # 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 ︡1a6a7d17-1b66-4f8c-80f1-70a34ecff7fb︡{"stdout": "99.785706509626166"}︡ ︠11308870-dac9-4ef3-98a0-709b96498743︠ # 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) ︡b4258d0a-8f18-4baf-83e1-25e996d62bf6︡{"stdout": "Warning: The iteration is not making good progress, as measured by the \n improvement from the last ten iterations.\n199.5458489705228"}︡ ︠35bf2cde-2514-4383-918e-3b69bf93e95e︠ int(round(fsolve( lambda N: mybinom(N)-0.02,100, warning = False))) ︡a6dfb7cb-07cb-44ff-b5aa-cf2de1eb91d8︡{"stdout": "200"}︡