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 />

References<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 />

“The Exponential Distribution: Theory, Methods and Applications”, N. Balakrishnan, Asit P. Basu<br />

Examples<br />

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

>>> numargs = genexpon.numargs<br />

>>> [ a,b,c ] = [0.9,]*numargs<br />

>>> rv = genexpon(a,b,c)<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 = genexpon.cdf(x,a,b,c)<br />

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

Random number generation<br />

>>> R = genexpon.rvs(a,b,c,size=100)<br />

Generalized exponential distribution (Ryu 1993)<br />

f(x,a,b,c) = (a+b*(1-exp(-c*x))) * exp(-a*x-b*x+b/c*(1-exp(-c*x))) for x >= 0, a,b,c > 0.<br />

a, b, c are the first, second and third shape parameters.<br />

508 Chapter 3. Reference

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

Saved successfully!

Ooh no, something went wrong!