74 3 UNIVARIATE STATISTICS
Alternatively, we can use the function mle to t a normal distribution, but
also other distributions such as binomial or exponential distributions, to
the data. e function
mle(data,'distribution',dist) computes
parameter estimates for the distribution speci ed by
dist. Acceptable
strings for
dist can be obtained by typing help mle.
phat = mle(data,'distribution','normal');
e variable phat contains the values of the parameters describing the type
of distribution tted to the data. As before, we can now calculate and scale
the probability density function
y, and display the result.
x = 2 : 1/20 : 10;
y = normpdf(x,phat(:,1),phat(:,2));
y = trapz(v,n) * y/trapz(x,y);
bar(v,n), hold on, plot(x,y,'r'), hold off
In earth sciences we o en encounter mixed distributions. Examples are
multimodal grain size distributions (Section 8.8), multiple preferred paleo-
current directions (Section 10.6), or multimodal chemical ages of monazite
re ecting multiple episodes of deformation and metamorphism in a moun-
tain belt. Fitting Gaussian mixture distributions to the data aims to deter-
mine the means and variances of the individual distributions that combine
to produce the mixed distribution. In our examples, the methods described
in this section help to determine the episodes of deformation in the moun-
tain range, or to separate the di erent paleocurrent directions caused by
tidal ow in an ocean basin.
As a synthetic example of Gaussian mixture distributions we generate
two sets of 100 random numbers
ya and yb with means of 6.4 and 13.3,
respectively, and standard deviations of 1.4 and 1.8, respectively. We then
vertically concatenate the series using
vertcat and store the 200 data val-
ues in the variable
data.
clear
randn('seed',0)
ya = 6.4 + 1.4*randn(100,1);
yb = 13.3 + 1.8*randn(100,1);
data = vertcat(ya,yb);
Plotting the histogram reveals a bimodal distribution. We can also deter-
mine the frequency distribution
n using hist.
v = 0 : 30;
hist(data,v)