# set terminal svg size 600,400 dynamic enhanced fname 'arial' fsize 10 mousing name "random_4" butt dashlength 1.0 # set output 'random.4.svg' set bar 1.000000 front set style circle radius graph 0.02, first 0.00000, 0.00000 set style ellipse size graph 0.05, 0.03, first 0.00000 angle 0 units xy set format x "%3.2f" set format y "%3.2f" set format z "%3.2f" set grid nopolar set grid xtics nomxtics ytics nomytics noztics nomztics \ nox2tics nomx2tics noy2tics nomy2tics nocbtics nomcbtics set grid layerdefault lt black linewidth 0.200 dashtype solid, lt black linewidth 0.200 dashtype solid set style textbox transparent margins 1.0, 1.0 border unset logscale set view 68, 28, 1, 1 set samples 200, 200 set isosamples 30, 30 set cntrlabel onecolor format '%8.3g' font '' start 5 interval 20 set hidden3d back offset 1 trianglepattern 3 undefined 1 altdiagonal bentover set cntrparam levels discrete 0.1 set style data lines set style function dots set xyplane relative 0 set ztics norangelimit 0.00000,0.05 set paxis 1 tics border in scale 1,0.5 nomirror norotate autojustify set paxis 1 tics rangelimit autofreq set paxis 2 tics border in scale 1,0.5 nomirror norotate autojustify set paxis 2 tics rangelimit autofreq set paxis 3 tics border in scale 1,0.5 nomirror norotate autojustify set paxis 3 tics rangelimit autofreq set paxis 4 tics border in scale 1,0.5 nomirror norotate autojustify set paxis 4 tics rangelimit autofreq set paxis 5 tics border in scale 1,0.5 nomirror norotate autojustify set paxis 5 tics rangelimit autofreq set paxis 6 tics border in scale 1,0.5 nomirror norotate autojustify set paxis 6 tics rangelimit autofreq set paxis 7 tics border in scale 1,0.5 nomirror norotate autojustify set paxis 7 tics rangelimit autofreq set title "Histogram of 5000 random samples from a univariate\nGaussian PDF with unit variance and zero mean" set urange [ -3.00000 : 3.00000 ] noreverse nowriteback set vrange [ -3.00000 : 3.00000 ] noreverse nowriteback set xrange [ -3.00000 : 3.00000 ] noreverse nowriteback set yrange [ 0.00000 : 0.450000 ] noreverse nowriteback set zrange [ -0.200000 : 0.200000 ] noreverse nowriteback set paxis 1 range [ * : * ] noreverse nowriteback set paxis 2 range [ * : * ] noreverse nowriteback set paxis 3 range [ * : * ] noreverse nowriteback set paxis 4 range [ * : * ] noreverse nowriteback set paxis 5 range [ * : * ] noreverse nowriteback set paxis 6 range [ * : * ] noreverse nowriteback set paxis 7 range [ * : * ] noreverse nowriteback set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front noinvert bdefault tstring(n) = sprintf("Histogram of %d random samples from a univariate\nGaussian PDF with unit variance and zero mean", n) isint(x)=(int(x)==x) Binv(p,q)=exp(lgamma(p+q)-lgamma(p)-lgamma(q)) arcsin(x,r)=r<=0?1/0:abs(x)>r?0.0:invpi/sqrt(r*r-x*x) beta(x,p,q)=p<=0||q<=0?1/0:x<0||x>1?0.0:Binv(p,q)*x**(p-1.0)*(1.0-x)**(q-1.0) binom(x,n,p)=p<0.0||p>1.0||n<0||!isint(n)?1/0: !isint(x)?1/0:x<0||x>n?0.0:exp(lgamma(n+1)-lgamma(n-x+1)-lgamma(x+1) +x*log(p)+(n-x)*log(1.0-p)) cauchy(x,a,b)=b<=0?1/0:b/(pi*(b*b+(x-a)**2)) chisq(x,k)=k<=0||!isint(k)?1/0: x<=0?0.0:exp((0.5*k-1.0)*log(x)-0.5*x-lgamma(0.5*k)-k*0.5*log2) erlang(x,n,lambda)=n<=0||!isint(n)||lambda<=0?1/0: x<0?0.0:x==0?(n==1?real(lambda):0.0):exp(n*log(lambda)+(n-1.0)*log(x)-lgamma(n)-lambda*x) extreme(x,mu,alpha)=alpha<=0?1/0:alpha*(exp(-alpha*(x-mu)-exp(-alpha*(x-mu)))) f(x,d1,d2)=d1<=0||!isint(d1)||d2<=0||!isint(d2)?1/0: Binv(0.5*d1,0.5*d2)*(real(d1)/d2)**(0.5*d1)*x**(0.5*d1-1.0)/(1.0+(real(d1)/d2)*x)**(0.5*(d1+d2)) gmm(x,rho,lambda)=rho<=0||lambda<=0?1/0: x<0?0.0:x==0?(rho>1?0.0:rho==1?real(lambda):1/0): exp(rho*log(lambda)+(rho-1.0)*log(x)-lgamma(rho)-lambda*x) geometric(x,p)=p<=0||p>1?1/0: !isint(x)?1/0:x<0||p==1?(x==0?1.0:0.0):exp(log(p)+x*log(1.0-p)) halfnormal(x,sigma)=sigma<=0?1/0:x<0?0.0:sqrt2invpi/sigma*exp(-0.5*(x/sigma)**2) hypgeo(x,N,C,d)=N<0||!isint(N)||C<0||C>N||!isint(C)||d<0||d>N||!isint(d)?1/0: !isint(x)?1/0:x>d||x>C||x<0||x1?1/0: !isint(x)?1/0:x<0?0.0:p==1?(x==0?1.0:0.0):exp(lgamma(r+x)-lgamma(r)-lgamma(x+1)+ r*log(p)+x*log(1.0-p)) nexp(x,lambda)=lambda<=0?1/0:x<0?0.0:lambda*exp(-lambda*x) normal(x,mu,sigma)=sigma<=0?1/0:invsqrt2pi/sigma*exp(-0.5*((x-mu)/sigma)**2) pareto(x,a,b)=a<=0||b<0||!isint(b)?1/0:x=a?0.0:f==0?1.0/a:2.0/a*sin(f*pi*x/a)**2/(1-sin(twopi*f)) t(x,nu)=nu<0||!isint(nu)?1/0: Binv(0.5*nu,0.5)/sqrt(nu)*(1+real(x*x)/nu)**(-0.5*(nu+1.0)) triangular(x,m,g)=g<=0?1/0:x=m+g?0.0:1.0/g-abs(x-m)/real(g*g) uniform(x,a,b)=x<(a=(a>b?a:b)?0.0:1.0/abs(b-a) weibull(x,a,lambda)=a<=0||lambda<=0?1/0: x<0?0.0:x==0?(a>1?0.0:a==1?real(lambda):1/0): exp(log(a)+a*log(lambda)+(a-1)*log(x)-(lambda*x)**a) carcsin(x,r)=r<=0?1/0:x<-r?0.0:x>r?1.0:0.5+invpi*asin(x/r) cbeta(x,p,q)=ibeta(p,q,x) cbinom(x,n,p)=p<0.0||p>1.0||n<0||!isint(n)?1/0: !isint(x)?1/0:x<0?0.0:x>=n?1.0:ibeta(n-x,x+1.0,1.0-p) ccauchy(x,a,b)=b<=0?1/0:0.5+invpi*atan((x-a)/b) cchisq(x,k)=k<=0||!isint(k)?1/0:x<0?0.0:igamma(0.5*k,0.5*x) cerlang(x,n,lambda)=n<=0||!isint(n)||lambda<=0?1/0:x<0?0.0:igamma(n,lambda*x) cextreme(x,mu,alpha)=alpha<=0?1/0:exp(-exp(-alpha*(x-mu))) cf(x,d1,d2)=d1<=0||!isint(d1)||d2<=0||!isint(d2)?1/0:1.0-ibeta(0.5*d2,0.5*d1,d2/(d2+d1*x)) cgmm(x,rho,lambda)=rho<=0||lambda<=0?1/0:x<0?0.0:igamma(rho,x*lambda) cgeometric(x,p)=p<=0||p>1?1/0: !isint(x)?1/0:x<0||p==0?0.0:p==1?1.0:1.0-exp((x+1)*log(1.0-p)) chalfnormal(x,sigma)=sigma<=0?1/0:x<0?0.0:erf(x/sigma/sqrt2) chypgeo(x,N,C,d)=N<0||!isint(N)||C<0||C>N||!isint(C)||d<0||d>N||!isint(d)?1/0: !isint(x)?1/0:x<0||xd||x>C?1.0:hypgeo(x,N,C,d)+chypgeo(x-1,N,C,d) claplace(x,mu,b)=b<=0?1/0:(x1?1/0: !isint(x)?1/0:x<0?0.0:ibeta(r,x+1,p) cnexp(x,lambda)=lambda<=0?1/0:x<0?0.0:1-exp(-lambda*x) cpareto(x,a,b)=a<=0||b<0||!isint(b)?1/0:xa?1.0:f==0?real(x)/a:(real(x)/a-sin(f*twopi*x/a)/(f*twopi))/(1.0-sin(twopi*f)/(twopi*f)) ct(x,nu)=nu<0||!isint(nu)?1/0:0.5+0.5*sgn(x)*(1-ibeta(0.5*nu,0.5,nu/(nu+x*x))) ctriangular(x,m,g)=g<=0?1/0: x=m+g?1.0:0.5+real(x-m)/g-(x-m)*abs(x-m)/(2.0*g*g) cuniform(x,a,b)=x<(a=(a>b?a:b)?1.0:real(x-a)/(b-a) cweibull(x,a,lambda)=a<=0||lambda<=0?1/0:x<0?0.0:1.0-exp(-(lambda*x)**a) bin(x) = (1.0/scale)*floor(x*scale) nsamp = 5000 i = 5001 GPFUN_tstring = "tstring(n) = sprintf(\"Histogram of %d random samples from a univariate\\nGaussian PDF with unit variance and zero mean\", n)" u = 0.0 GPFUN_isint = "isint(x)=(int(x)==x)" fourinvsqrtpi = 2.25675833419103 invpi = 0.318309886183791 invsqrt2pi = 0.398942280401433 log2 = 0.693147180559945 sqrt2 = 1.4142135623731 sqrt2invpi = 0.797884560802865 twopi = 6.28318530717959 GPFUN_Binv = "Binv(p,q)=exp(lgamma(p+q)-lgamma(p)-lgamma(q))" GPFUN_arcsin = "arcsin(x,r)=r<=0?1/0:abs(x)>r?0.0:invpi/sqrt(r*r-x*x)" GPFUN_beta = "beta(x,p,q)=p<=0||q<=0?1/0:x<0||x>1?0.0:Binv(p,q)*x**(p-1.0)*(1.0-x)**(q-1.0)" GPFUN_binom = "binom(x,n,p)=p<0.0||p>1.0||n<0||!isint(n)?1/0: !isint(x)?1/0:x<0||x>n?0.0:exp(lgamma(n+1)-lgamma(n-x+1)-lgamma(x+1) +x*log(p)+(n-x)*log(1.0-p))" GPFUN_cauchy = "cauchy(x,a,b)=b<=0?1/0:b/(pi*(b*b+(x-a)**2))" GPFUN_chisq = "chisq(x,k)=k<=0||!isint(k)?1/0: x<=0?0.0:exp((0.5*k-1.0)*log(x)-0.5*x-lgamma(0.5*k)-k*0.5*log2)" GPFUN_erlang = "erlang(x,n,lambda)=n<=0||!isint(n)||lambda<=0?1/0: x<0?0.0:x==0?(n==1?real(lambda):0.0):exp(n*log(lambda)+(n-1.0)*log(x)-lgamma(n)-lambda*x)" GPFUN_extreme = "extreme(x,mu,alpha)=alpha<=0?1/0:alpha*(exp(-alpha*(x-mu)-exp(-alpha*(x-mu))))" GPFUN_f = "f(x,d1,d2)=d1<=0||!isint(d1)||d2<=0||!isint(d2)?1/0: Binv(0.5*d1,0.5*d2)*(real(d1)/d2)**(0.5*d1)*x**(0.5*d1-1.0)/(1.0+(real(d1)/d2)*x)**(0.5*(d1+d2))" GPFUN_gmm = "gmm(x,rho,lambda)=rho<=0||lambda<=0?1/0: x<0?0.0:x==0?(rho>1?0.0:rho==1?real(lambda):1/0): exp(rho*log(lambda)+(rho-1.0)*log(x)-lgamma(rho)-lambda*x)" GPFUN_geometric = "geometric(x,p)=p<=0||p>1?1/0: !isint(x)?1/0:x<0||p==1?(x==0?1.0:0.0):exp(log(p)+x*log(1.0-p))" GPFUN_halfnormal = "halfnormal(x,sigma)=sigma<=0?1/0:x<0?0.0:sqrt2invpi/sigma*exp(-0.5*(x/sigma)**2)" GPFUN_hypgeo = "hypgeo(x,N,C,d)=N<0||!isint(N)||C<0||C>N||!isint(C)||d<0||d>N||!isint(d)?1/0: !isint(x)?1/0:x>d||x>C||x<0||x