15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Methods<br />

nbinom.rvs(n,pr,loc=0,size=1)<br />

nbinom.pmf(x,n,pr,loc=0)<br />

nbinom.cdf(x,n,pr,loc=0)<br />

nbinom.sf(x,n,pr,loc=0)<br />

nbinom.ppf(q,n,pr,loc=0)<br />

nbinom.isf(q,n,pr,loc=0)<br />

nbinom.stats(n,pr,loc=0,moments=’mv’)<br />

nbinom.entropy(n,pr,loc=0)<br />

Alternatively, the object may be called (as a<br />

function) to fix<br />

the shape and location parameters returning a<br />

“frozen” discrete RV object:<br />

myrv = nbinom(n,pr,loc=0)<br />

You can construct an aribtrary discrete rv where<br />

P{X=xk} = pk<br />

by passing to the rv_discrete initialization method<br />

(through the values=<br />

keyword) a tuple of sequences (xk,pk) which<br />

describes only those values of<br />

X (xk) that occur with nonzero probability (pk).<br />

geom<br />

A geometric discrete random variable.<br />

SciPy Reference Guide, Release 0.8.dev<br />

•random variates<br />

•probability mass function<br />

•cumulative density function<br />

•survival function (1-cdf — sometimes more accurate)<br />

•percent point function (inverse of cdf — percentiles)<br />

•inverse survival function (inverse of sf)<br />

•mean(‘m’,axis=0), variance(‘v’), skew(‘s’), and/or<br />

kurtosis(‘k’)<br />

•entropy of the RV<br />

•frozen RV object with the same methods but holding<br />

the given shape and location fixed.<br />

Discrete random variables are defined from a standard form and may require some shape parameters to complete<br />

its specification. Any optional keyword parameters can be passed to the methods of the RV object as given<br />

below:<br />

Examples<br />

>>> import matplotlib.pyplot as plt<br />

>>> numargs = geom.numargs<br />

>>> [ pr ] = [’Replace with resonable value’,]*numargs<br />

3.18. Statistical functions (<strong>scipy</strong>.stats) 619

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!