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.

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

Examples<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 = loggamma.numargs<br />

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

>>> rv = loggamma()<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 />

>>> prb = loggamma.cdf(x,)<br />

>>> h=plt.semilogy(np.abs(x-loggamma.ppf(prb,))+1e-20)<br />

Random number generation<br />

>>> R = loggamma.rvs(size=100)<br />

Log gamma distribution<br />

loggamma.pdf(x,c) = exp(c*x-exp(x)) / gamma(c) for all x, c > 0.<br />

548 Chapter 3. Reference

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

Saved successfully!

Ooh no, something went wrong!