Geoscience Reference
In-Depth Information
Test for Random Distribution
h e following example illustrates the test for random distribution of objects
within an area. We use the uniformly-distributed data generated in the
previous example and display the point distribution.
clear
rng(5)
data = 10 * rand(100,2);
plot(data(:,1),data(:,2),'o')
hold on
x = 0:10; y = ones(size(x));
for i = 1:9, plot(x,i*y,'r-'), end
for i = 1:9, plot(i*y,x,'r-'), end
hold off
We then generate the three-dimensional histogram and use the function
hist3 to count the objects per class. In contrast to the previous test, we now
count the subareas containing a certain number of observations. h enumber
of subareas is larger than would normally be used for the previous test. In
our example we use 49 subareas or classes.
hist3(data,[7 7])
view(30,70)
counts = hist3(data,[7 7]);
counts = counts(:);
h e frequency distribution of those subareas that contain a specii c number
of objects follows a Poisson distribution (Section 3.5) if the objects are
randomly distributed. First, we compute a frequency distribution of the
subareas containing N objects. In our example we count the subareas with 0,
…, 5 objects. We also display the histogram of the frequency distribution as a
two-dimensional histogram using histogram , at er having i rst calculated the
bin edges E from the bin centers N (Section 3.3) (Fig. 7.12).
N = 0 : 5;
E = -0.5 : 1 : 5.5;
h = histogram(counts,E);
title('Histogram')
xlabel('Number of observations N')
ylabel('Subareas with N observations')
v = h.BinWidth * 0.5 + h.BinEdges(1:end-1);
n_obs = h.Values;
Search WWH ::




Custom Search