Extreme value (Gumbel) random numbers
R = distfun_evrnd ( mu , sigma ) R = distfun_evrnd ( mu , sigma , [m,n] ) R = distfun_evrnd ( mu , sigma , m , n )
a matrix of doubles, the average
a matrix of doubles, the standard deviation. sigma>0.
a 1-by-1 matrix of floating point integers, the number of rows of R
a 1-by-1 matrix of floating point integers, the number of columns of R
a matrix of doubles, the random numbers.
Generates random variables from the Extreme value (Gumbel) distribution function. This is the minimum Gumbel distribution.
Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.
To get max-Gumbel random numbers:
y = -distfun_evrnd(-mu,sigma,m,n)
// Set the seed so as to always get the same results. distfun_seedset(1); // Test both mu and sigma expanded computed = distfun_evrnd(1,2,[5,5]) // Plot Gumbel random numbers N=1000; x=linspace(-20,5,N); y1=distfun_evpdf(x,0.5,2.); R=distfun_evrnd(0.5,2,10000,1); scf(); xtitle("Gumbel distribution","x","Density"); plot(x,y1) histplot(20,R); legend(["PDF","Data"],"in_upper_left"); // Compare with CDF R=gsort(R,"g","i"); n=size(R,"*"); p=distfun_evcdf(R,0.5,2,%t); scf(); plot(R,(1:n)'/n,"r-"); plot(R,p,"b-"); legend(["Empirical","CDF"],"in_upper_left"); xtitle("Gumbel distribution","x","P(X<x)"); | ![]() | ![]() |