KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /proc/22697/root/usr/lib64/python2.4/site-packages/Numeric/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/22697/root/usr/lib64/python2.4/site-packages/Numeric/RandomArray.pyo
mò
C1?c@sdkZdkZdkZdkZdkZdkTdefd„ƒYZddd„Zeƒd„Z	gd„Z
gd„Zgd	„Zdgd
„Zdgd„Zd
„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zgd„Zd„Z e!djoe ƒndS(N(t*t
ArgumentErrorcBstZRS(N(t__name__t
__module__(((t9/usr/lib64/python2.4/site-packages/Numeric/RandomArray.pyR
sicCs´t|ƒtjpt|ƒtjo
td‚n|djo`dk}|iƒ}tti	|ƒƒ}d|d}t||ƒ}dt||ƒ}nti
||ƒdS(sbseed(x, y), set the seed using the integers x, y; 
    Set a random one from clock if  y == 0
    s seed requires integer arguments.iNi
ii(ttypetxtIntTypetyRttimetttinttmathtlog10tndigitstbasetranlibt	set_seeds(RRRRR
R	((Rtseeds&

	cCs
tiƒS(sReturn the current seed pairN(Rt	get_seeds(((Rtget_seed!scCs‘t|tƒo
|g}nt|ƒdjo9tii|ƒ}t|||fƒ}||_|Sn%d}t|||fƒ}|dSdS(Nii(t
isinstancetshapeRtlentNumerictmultiplytreducetntapplytfuntargsts(RRRRR((Rt_build_random_array%s
	cCsttif|ƒS(s@random(n) or random([n, m, ...]) returns array of random numbersN(R RtsampleR(R((Rtrandom6scCs|||t|ƒS(sduniform(minimum, maximum, shape=[]) returns array of given shape of random reals 
    in given rangeN(tminimumtmaximumR"R(R#R$R((Rtuniform:scCs¨t|tƒp
td‚n|djo|}d}nt|tƒp
td‚n||t|ƒ}t|t	i
ƒo||it	iƒSn|t
|ƒSdS(skrandint(min, max, shape=[]) = random integers >=min, < max
    If max not given, random integers >= 0, <mins'randint requires first argument integeris(randint requires second argument integerN(RR#RRR$tNoneR"RtaRt	ArrayTypetastypetIntR(R#R$RR'((Rtrandint?s



icCst||d|ƒS(sRrandom_integers(max, min=1, shape=[]) = random integers in range min-max inclusiveiN(R+R#R$R(R$R#R((Rtrandom_integersOscCstit|ƒƒS(s2permutation(n) = a permutation of indices range(n)N(RtargsortR"R(R((RtpermutationSscCsttif|ƒS(s¢standard_normal(n) or standard_normal([n, m, ...]) returns array of
           random numbers normally distributed with mean 0 and standard
           deviation 1N(R Rtstandard_normalR(R((RR/WscCst|ƒ}|||S(s¬normal(mean, std, n) or normal(mean, std, [n, m, ...]) returns
           array of random numbers randomly distributed with specified mean and
           standard deviationN(R/RRtstdtmean(R1R0RR((Rtnormal]scCsŠti|ƒ}ti|ƒ}t|iƒdjo
td‚nt|iƒdjp|id|idjo
td‚n|id|idjo
td‚nt|tƒo
|g}nt	|ƒ}|i|idƒti
tii|ƒƒ}tii|dt|ƒd!ƒ|idf|_ti|ƒ\}}}ti|ti|ƒ|ƒ}ti|||ƒ||_|S(s‹multivariate_normal(mean, cov) or multivariate_normal(mean, cov, [m, n, ...])
          returns an array containing multivariate normally distributed random numbers
          with specified mean and covariance.

          mean must be a 1 dimensional array. cov must be a square two dimensional
          array with the same number of rows and columns as mean has elements.

          The first form returns a single 1-D array containing a multivariate
          normal.

          The second form returns an array of shape (m, n, ..., cov.shape[0]).
          In this case, output[i,j,...,:] is a 1-D array containing a multivariate
          normal.ismean must be 1 dimensional.iis%cov must be 2 dimensional and square.s#mean and cov must have same length.N(RtarrayR1tcovRRRRRtlisttfinal_shapetappendRR/RRRt
LinearAlgebratsingular_value_decompositiontuRtvtmatrixmultiplytsqrttadd(R1R4RR6RR:R;R((Rtmultivariate_normalds(

1



3	cCsFt|ƒ}ti||ƒtid||ƒti|||ƒ|S(sŠexponential(mean, n) or exponential(mean, [n, m, ...]) returns array
      of random numbers exponentially distributed with specified meanf0.0N(R"RRRtlogtsubtractRR1(R1RR((Rtexponential“scCstti||f|ƒS(sWbeta(a, b) or beta(a, b, [n, m, ...]) returns array of beta distributed random numbers.N(R RtbetaR'tbR(R'RDR((RRCŸscCstti||f|ƒS(sZgamma(a, r) or gamma(a, r, [n, m, ...]) returns array of gamma distributed random numbers.N(R RtgammaR'trR(R'RFR((RRE£scCs"t||ƒ|t||ƒ|S(s±F(dfn, dfd) or F(dfn, dfd, [n, m, ...]) returns array of F distributed random numbers with dfn degrees of freedom in the numerator and dfd degrees of freedom in the denominator.N(t
chi_squaretdfnRtdfd(RHRIR((RtF§scCs%t|||ƒ|t||ƒ|S(snoncentral_F(dfn, dfd, nonc) or noncentral_F(dfn, dfd, nonc, [n, m, ...]) returns array of noncentral F distributed random numbers with dfn degrees of freedom in the numerator and dfd degrees of freedom in the denominator, and noncentrality parameter nconc.N(tnoncentral_chi_squareRHtnconcRRGRI(RHRIRLR((Rtnoncentral_F«scCstti|f|ƒS(schi_square(df) or chi_square(df, [n, m, ...]) returns array of chi squared distributed random numbers with df degrees of freedom.N(R Rt	chisquaretdfR(ROR((RRG¯scCstti||f|ƒS(sÁnoncentral_chi_square(df, nconc) or chi_square(df, nconc, [n, m, ...]) returns array of noncentral chi squared distributed random numbers with df degrees of freedom and noncentrality parameter.N(R Rtnoncentral_chisquareRORLR(RORLR((RRK³scCstti||f|ƒS(sbinomial(trials, p) or binomial(trials, p, [n, m, ...]) returns array of binomially distributed random integers.

           trials is the number of trials in the binomial distribution.
           p is the probability of an event in each trial of the binomial distribution.N(R RtbinomialttrialstpR(RRRSR((RRQ·scCstti||f|ƒS(sInegative_binomial(trials, p) or negative_binomial(trials, p, [n, m, ...]) returns
           array of negative binomially distributed random integers.

           trials is the number of trials in the negative binomial distribution.
           p is the probability of an event in each trial of the negative binomial distribution.N(R Rtnegative_binomialRRRSR(RRRSR((RRT¾scCs±ti|ƒ}t|iƒdjo
td‚nt|ƒtdƒjo
|g}n|}|i|iddƒt	i
||iti
ƒtii|ƒƒ}||_|S(sïmultinomial(trials, probs) or multinomial(trials, probs, [n, m, ...]) returns
           array of multinomial distributed integer vectors.

           trials is the number of trials in each multinomial distribution.
           probs is a one dimensional array. There are len(prob)+1 events. 
           prob[i] is the probability of the i-th event, 0<=i<len(prob).
           The probability of event len(prob) is 1.-Numeric.sum(prob).

       The first form returns a single 1-D array containing one multinomially
           distributed vector.

           The second form returns an array of shape (m, n, ..., len(probs)).
           In this case, output[i,j,...,:] is a 1-D array containing a multinomially
           distributed integer 1-D array.isprobs must be 1 dimensional.iN(RR3tprobsRRRRR6R7RtmultinomialRRR)tFloat32RRR(RRRURR6R((RRVÆs

-	cCstti|f|ƒS(spoisson(mean) or poisson(mean, [n, m, ...]) returns array of poisson
           distributed random integers with specifed mean.N(R RtpoissonR1R(R1R((RRXâsc
CsÊt|ƒd}ti|ƒ|}	||	}ti||ƒ|d}dGt|ƒG|GHdG|GdG|	GHdG|GdG|GH|gjo<ti|||ƒd|dd}d	G|GdG|GHndS(
Nf1.0s
Average of s(should be about s):s2Variance of those random numbers (should be about f9998.0f3.0f2.0s2Skewness of those random numbers (should be about (
RRRRtsumtx_meantx_minus_meantx_varRR1tvartskewtx_skew(
RRR1R]R^R_RR[R\RZ((Rt
mean_var_testès

'c	Csltƒ\}}dG|G|GHt||ƒtƒ\}}||jp
||jo
td‚ndGtƒGHdGti	tdƒƒdGHtddgƒ}t
|iƒd	jp(|id
djp|iddjo
td‚ndB|_d
Gti	|ƒdGHtdddCƒ}t
|iƒd	jp(|id
djp|iddjo
td‚ndD|_ti
i|ƒdjptii|ƒdjo
td‚ndGHtddddgƒGHdGtdƒGHdGtddƒGHdGHtdddgƒGHd}td|ddgƒ}t
|iƒd	jp(|id
djp|iddjo
td‚ndE|_t|d|d	fd	|d	d
ƒtddƒ}t|d|f||d	d	ƒttiddgƒtidd	gd	d gfƒƒ}d!G|GH|idFjo
td"‚nttiddgƒtidd	gd	d ggƒd dgƒ}d#GH|GH|idGjo
td"‚nttid$d
d%gƒtidd	dgd	d	dgdddggƒdƒ}ti	|ƒd}d&GH|GH||}d'GHtiti|ƒ|ƒd(GHtd)d*dƒ}t|d+d,d-ƒtd.ddƒ}t|d/d	d%d	d%d%ƒtd0dƒ}t|d1d2d3d	ti dd0ƒƒt!d)d*dƒ}t|d4d5d6ƒt"d7dƒ}t|d8ddd9ƒd:GHt#d;dd;ƒGHd<GHt$d;dd;gƒGHd=GHt%d;d>dd>gd?ƒ}|GHd@Gti	|ƒdAGHdS(HNsInitial seedsFailed seed test.sFirst random number iss"Average of 10000 random numbers isi'f10000.0i
ièiiisrandom returned wrong shapes'Average of 100 by 100 random numbers isf0.5f0.59999999999999998suniform returned wrong shapes%uniform returned out of desired rangesrandint(1, 10, shape=[50])Ri2spermutation(10)srandint(3,9)ii	srandom_integers(10, shape=[20])if3.0f2.0s$standard_normal returned wrong shapes8normally distributed numbers with mean 2 and variance %fs5random numbers exponentially distributed with mean %fis
A multivariate normals(multivariate_normal returned wrong shapes-A 4x3x2 array containing multivariate normalsiœÿÿÿids<Average of 10000 multivariate normals with mean [-100,0,100]s\Estimated covariance of 10000 multivariate normals with covariance [[3,2,1],[2,2,1],[1,1,1]]f9999.0f5.0f10.0sbeta(5.,10.) random numbersf0.33300000000000002f0.014f0.01sgamma(.01,2.) random numbersf11.0s5chi squared random numbers with 11 degrees of freedomiis1F random numbers with 5 and 10 degrees of freedomf1.25f1.3500000000000001f50.0s#poisson random numbers with mean 50f0.14000000000000001sG
Each element is the result of 16 binomial trials with probability 0.5:isP
Each element is the result of 16 negative binomial trials with probability 0.5:sX
Each row is the result of 16 multinomial trials with probabilities [0.1, 0.5, 0.1 0.3]:f0.10000000000000001isMean = f8.0(i'(ièi
(i'(i'(i(iii(&RRRRtx1ty1t
SystemExitR"RRYRRR%R#RR$R+R.R,RR2R`RBR?R3RZR[R<t	transposeRCRERGR=RJRXRQRTRV(RbRaRZRR[RR((Rttestôs†


>
	>
	2
>
	%!9	
B
Q
't__main__("RRR8tsysRttypest	ExceptionRRRR R"R%R&R+R,R.R/R2R?RBRCRERJRMRGRKRQRTRVRXR`ReR(R"R,RRR`R+RJR%R8RMReRR/R2RVRRgRCRQRTRGR RKRBR?RRXR.RRE((Rt?sB							/	C


Anon7 - 2021