15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Each included continuous distribution is an instance of the class rv_continous:<br />

rv_continuous([momtype, a, b, xa, xb, xtol, ...]) A Generic continuous random variable.<br />

rv_continuous.pdf(x, *args, **kwds) Probability density function at x of the given RV.<br />

rv_continuous.cdf(x, *args, **kwds) Cumulative distribution function at x of the given RV.<br />

rv_continuous.sf(x, *args, **kwds) Survival function (1-cdf) at x of the given RV.<br />

rv_continuous.ppf(q, *args, **kwds) Percent point function (inverse of cdf) at q of the given RV.<br />

rv_continuous.isf(q, *args, **kwds) Inverse survival function at q of the given RV.<br />

rv_continuous.stats(*args, **kwds) Some statistics of the given RV<br />

class rv_continuous(momtype=1, a=None, b=None, xa=-10.0, xb=10.0, xtol=1e-14, badvalue=None,<br />

name=None, longname=None, shapes=None, extradoc=None)<br />

A Generic continuous random variable.<br />

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

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

given below:<br />

Examples<br />

Parameters<br />

x : array-like<br />

quantiles<br />

q : array-like<br />

lower or upper tail probability<br />

: array-like<br />

shape parameters<br />

loc : array-like, optional<br />

location parameter (default=0)<br />

scale : array-like, optional<br />

scale parameter (default=1)<br />

size : int or tuple of ints, optional<br />

shape of random variates (default computed from input arguments )<br />

moments : string, optional<br />

composed of letters [’mvsk’] specifying which moments to compute where ‘m’<br />

= mean, ‘v’ = variance, ‘s’ = (Fisher’s) skew and ‘k’ = (Fisher’s) kurtosis. (default=’mv’)<br />

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

>>> numargs = generic.numargs<br />

>>> [ ] = [0.9,]*numargs<br />

>>> rv = generic()<br />

Display frozen pdf<br />

>>> x = np.linspace(0,np.minimum(rv.dist.b,3))<br />

>>> h=plt.plot(x,rv.pdf(x))<br />

Check accuracy of cdf and ppf<br />

448 Chapter 3. Reference

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

Saved successfully!

Ooh no, something went wrong!