Python Programming for Biology: Bioinformatics and Beyond


Figure 21.9.  An example output of the Poisson distribution



Download 7,75 Mb.
Pdf ko'rish
bet328/514
Sana30.12.2021
Hajmi7,75 Mb.
#91066
1   ...   324   325   326   327   328   329   330   331   ...   514
Bog'liq
[Tim J. Stevens, Wayne Boucher] Python Programming

Figure 21.9.  An example output of the Poisson distribution. A graph of the output

generated using the poisson.pmf() function from the scipy.stats module, tested for an event

rate of 2500. The graph illustrates the probability density for discrete numbers of events in

the range from 2300 to 2700. This is a very good approximation for the binomial

distribution illustrated above (

Figure 21.7

).

Figure 21.10.  An example output of the geometric distribution. A graph of the output

generated using the geom.pmf() function from the scipy.stats module, tested for an event

probability of 0.0025. The graph illustrates the probability for the number of independent

trials until the event occurs, in the range from 0 to 1000.

Again we can use SciPy to calculate the probabilities for the distribution, here using the

probability  for  a  restriction  enzyme  cut  site  to  get  the  distribution  in  the  DNA  fragment

lengths:

from scipy.stats import geom

from numpy import array

p = 0.0025

geomRandomVar = geom(p)

lengths = array(range(1, 1000))

probs = geomRandomVar.pmf(lengths)

pyplot.plot(lengths, probs)

pyplot.show()

The geometric distribution is the last discrete probability distribution we will describe

in  detail  but  there  are  several  other  distributions  that  are  easily  accessible  in  Python  via



their  implementation  in  the  scipy.stats  module.  Some  of  the  more  notable  available

probability distributions are as follows:

dlaplace: the discrete Laplace distribution; the differences between two independent

but  identically  distributed  random  variables  which  themselves  have  geometric

distributions.

hypergeom:  the  hypergeometric  distribution,  describing  the  number  of  successful

events occurring after selecting a given number of items from a population without

replacement. (With replacement the distribution would be binomial.)

nbinom:  the  negative  binomial  distribution,  a  generalisation  of  the  geometric

distribution for a variable number of events.

randint: the uniform distribution, i.e. where all values are equally likely.

skellam: the Skellam distribution, the differences between two independent random

variables which themselves have Poisson distributions and different mean values.


Download 7,75 Mb.

Do'stlaringiz bilan baham:
1   ...   324   325   326   327   328   329   330   331   ...   514




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish