402 STATISTICAL METHODS OF GEOPHYSICAL DATA PROCESSING
m1=trapz(x,x.*d) % mathematical expectation
s1=sqrt(trapz(x,(x-m1).ˆ 2.*d)) % standard deviation
%
pause
% comparison with the normal distribution
hold on
dn=d gauss(x,math exp,stand dev);
plot(x,dn,’g’); % graphic presentation
% of the normal distribution
The function d=d chisq(x,n) is represented below.
function d=d chisq(x,n)
% χ
2
-distribution d=d chisq(x,n)
% n : a number of the degree of freedom
% x : a row vector contains the values of argument (0 ¡ x ¡ inf)
% d : a row vector contains the values of the density function
%
d=((x./2).ˆ ((n./2)-1).*exp(-x ./ 2))/(2.*gamma(n./2));
A.1.3.5 Exponential distribution
Graphic presentation of the exponential density function (1.49) is realized by the
script d0expon.m. The function d=d expon(x,l) returns row vector d, Which con-
tains the values of the exponential density function.
A.1.3.6 Fisher distribution
Graphic presentation of the Fisher density function (1.48) is realized by the script
d0fish.m. The function d=d fish(x,n1,n2) returns row vector d, Which contains
the values of the Fisher density function.
A.1.3.7 Univariate normal (Gaussian) distribution
Graphic presentation of the normal density function (1.41) is realized by the script
d0gauss.m. The function d=d gauss(x,xm,s) returns row vector d, Which contains
the values of the normal density function.
A.1.3.8 Geometrical distribution
Graphic presentation of the geometrical density function (1.40) is realized by the
script d0geom.m. The function d=d geom(n,p) returns row vector d, Which contains
the values of the normal density function.